Popup Maker – Popup Forms, Optins & More - Version 1.8.3

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.8.3
Comparing to
See all releases

Code changes from version 1.8.2 to 1.8.3

Files changed (107) hide show
  1. classes/Admin.php +96 -91
  2. includes/functions/popups/getters.php +59 -42
  3. includes/pum-sdk/freemius/LICENSE.txt +673 -673
  4. includes/pum-sdk/freemius/README.md +253 -253
  5. includes/pum-sdk/freemius/assets/css/admin/account.css +1 -1
  6. includes/pum-sdk/freemius/assets/css/admin/add-ons.css +2 -2
  7. includes/pum-sdk/freemius/assets/css/admin/affiliation.css +1 -1
  8. includes/pum-sdk/freemius/assets/css/admin/checkout.css +1 -1
  9. includes/pum-sdk/freemius/assets/css/admin/common.css +2 -2
  10. includes/pum-sdk/freemius/assets/css/admin/connect.css +1 -1
  11. includes/pum-sdk/freemius/assets/css/admin/deactivation-feedback.css +0 -1
  12. includes/pum-sdk/freemius/assets/css/admin/debug.css +1 -1
  13. includes/pum-sdk/freemius/assets/css/admin/dialog-boxes.css +2 -2
  14. includes/pum-sdk/freemius/assets/css/admin/gdpr-optin-notice.css +1 -1
  15. includes/pum-sdk/freemius/assets/css/admin/index.php +2 -2
  16. includes/pum-sdk/freemius/assets/css/admin/license-activation.css +0 -1
  17. includes/pum-sdk/freemius/assets/css/customizer.css +1 -1
  18. includes/pum-sdk/freemius/assets/css/index.php +2 -2
  19. includes/pum-sdk/freemius/assets/img/index.php +2 -2
  20. includes/pum-sdk/freemius/assets/index.php +2 -2
  21. includes/pum-sdk/freemius/assets/js/index.php +2 -2
  22. includes/pum-sdk/freemius/assets/js/nojquery.ba-postmessage.js +139 -139
  23. includes/pum-sdk/freemius/assets/js/nojquery.ba-postmessage.min.js +11 -11
  24. includes/pum-sdk/freemius/assets/js/postmessage.js +134 -134
  25. includes/pum-sdk/freemius/assets/scss/_colors.scss +79 -68
  26. includes/pum-sdk/freemius/assets/scss/_mixins.scss +269 -269
  27. includes/pum-sdk/freemius/assets/scss/admin/_ajax-loader.scss +48 -48
  28. includes/pum-sdk/freemius/assets/scss/admin/_auto-install.scss +32 -32
  29. includes/pum-sdk/freemius/assets/scss/admin/_buttons.scss +28 -0
  30. includes/pum-sdk/freemius/assets/scss/admin/_deactivation-feedback.scss +54 -54
  31. includes/pum-sdk/freemius/assets/scss/admin/_gdpr-consent.scss +80 -80
  32. includes/pum-sdk/freemius/assets/scss/admin/_license-activation.scss +46 -46
  33. includes/pum-sdk/freemius/assets/scss/admin/_license-key-resend.scss +68 -68
  34. includes/pum-sdk/freemius/assets/scss/admin/_modal-common.scss +193 -193
  35. includes/pum-sdk/freemius/assets/scss/admin/_multisite-options.scss +39 -39
  36. includes/pum-sdk/freemius/assets/scss/admin/_plugin-upgrade-notice.scss +8 -0
  37. includes/pum-sdk/freemius/assets/scss/admin/_subscription-cancellation.scss +30 -0
  38. includes/pum-sdk/freemius/assets/scss/admin/_themes.scss +20 -20
  39. includes/pum-sdk/freemius/assets/scss/admin/_tooltip.scss +65 -65
  40. includes/pum-sdk/freemius/assets/scss/admin/account.scss +301 -301
  41. includes/pum-sdk/freemius/assets/scss/admin/add-ons.scss +448 -448
  42. includes/pum-sdk/freemius/assets/scss/admin/affiliation.scss +96 -96
  43. includes/pum-sdk/freemius/assets/scss/admin/checkout.scss +4 -4
  44. includes/pum-sdk/freemius/assets/scss/admin/common.scss +5 -3
  45. includes/pum-sdk/freemius/assets/scss/admin/debug.scss +134 -134
  46. includes/pum-sdk/freemius/assets/scss/admin/dialog-boxes.scss +10 -8
  47. includes/pum-sdk/freemius/assets/scss/admin/gdpr-optin-notice.scss +16 -16
  48. includes/pum-sdk/freemius/assets/scss/admin/index.php +2 -2
  49. includes/pum-sdk/freemius/assets/scss/customizer.scss +124 -124
  50. includes/pum-sdk/freemius/assets/scss/index.php +2 -2
  51. includes/pum-sdk/freemius/composer.json +10 -10
  52. includes/pum-sdk/freemius/config.php +387 -387
  53. includes/pum-sdk/freemius/includes/class-freemius-abstract.php +596 -596
  54. includes/pum-sdk/freemius/includes/class-freemius.php +1381 -350
  55. includes/pum-sdk/freemius/includes/class-fs-admin-notices.php +320 -320
  56. includes/pum-sdk/freemius/includes/class-fs-api.php +15 -5
  57. includes/pum-sdk/freemius/includes/class-fs-logger.php +690 -690
  58. includes/pum-sdk/freemius/includes/class-fs-plugin-updater.php +493 -68
  59. includes/pum-sdk/freemius/includes/class-fs-security.php +85 -85
  60. includes/pum-sdk/freemius/includes/class-fs-storage.php +2 -2
  61. includes/pum-sdk/freemius/includes/class-fs-user-lock.php +125 -125
  62. includes/pum-sdk/freemius/includes/customizer/class-fs-customizer-support-section.php +101 -101
  63. includes/pum-sdk/freemius/includes/customizer/class-fs-customizer-upsell-control.php +156 -156
  64. includes/pum-sdk/freemius/includes/customizer/index.php +2 -2
  65. includes/pum-sdk/freemius/includes/debug/class-fs-debug-bar-panel.php +64 -64
  66. includes/pum-sdk/freemius/includes/debug/debug-bar-start.php +51 -51
  67. includes/pum-sdk/freemius/includes/debug/index.php +2 -2
  68. includes/pum-sdk/freemius/includes/entities/class-fs-affiliate-terms.php +127 -127
  69. includes/pum-sdk/freemius/includes/entities/class-fs-affiliate.php +83 -83
  70. includes/pum-sdk/freemius/includes/entities/class-fs-billing.php +94 -94
  71. includes/pum-sdk/freemius/includes/entities/class-fs-entity.php +148 -148
  72. includes/pum-sdk/freemius/includes/entities/class-fs-payment.php +109 -109
  73. includes/pum-sdk/freemius/includes/entities/class-fs-plugin-info.php +33 -33
  74. includes/pum-sdk/freemius/includes/entities/class-fs-plugin-license.php +269 -269
  75. includes/pum-sdk/freemius/includes/entities/class-fs-plugin-plan.php +144 -144
  76. includes/pum-sdk/freemius/includes/entities/class-fs-plugin-tag.php +49 -49
  77. includes/pum-sdk/freemius/includes/entities/class-fs-plugin.php +141 -119
  78. includes/pum-sdk/freemius/includes/entities/class-fs-pricing.php +140 -140
  79. includes/pum-sdk/freemius/includes/entities/class-fs-scope-entity.php +28 -28
  80. includes/pum-sdk/freemius/includes/entities/class-fs-site.php +229 -224
  81. includes/pum-sdk/freemius/includes/entities/class-fs-subscription.php +124 -124
  82. includes/pum-sdk/freemius/includes/entities/class-fs-user.php +61 -61
  83. includes/pum-sdk/freemius/includes/entities/index.php +2 -2
  84. includes/pum-sdk/freemius/includes/fs-core-functions.php +115 -91
  85. includes/pum-sdk/freemius/includes/fs-essential-functions.php +4 -2
  86. includes/pum-sdk/freemius/includes/fs-plugin-info-dialog.php +44 -11
  87. includes/pum-sdk/freemius/includes/i18n.php +3 -3
  88. includes/pum-sdk/freemius/includes/index.php +2 -2
  89. includes/pum-sdk/freemius/includes/l10n.php +48 -48
  90. includes/pum-sdk/freemius/includes/managers/class-fs-admin-menu-manager.php +968 -956
  91. includes/pum-sdk/freemius/includes/managers/class-fs-admin-notice-manager.php +74 -0
  92. includes/pum-sdk/freemius/includes/managers/class-fs-cache-manager.php +325 -325
  93. includes/pum-sdk/freemius/includes/managers/class-fs-gdpr-manager.php +201 -201
  94. includes/pum-sdk/freemius/includes/managers/class-fs-key-value-storage.php +391 -391
  95. includes/pum-sdk/freemius/includes/managers/class-fs-license-manager.php +103 -103
  96. includes/pum-sdk/freemius/includes/managers/class-fs-option-manager.php +489 -489
  97. includes/pum-sdk/freemius/includes/managers/class-fs-plan-manager.php +161 -161
  98. includes/pum-sdk/freemius/includes/managers/index.php +2 -2
  99. includes/pum-sdk/freemius/includes/sdk/Exceptions/index.php +2 -2
  100. includes/pum-sdk/freemius/includes/sdk/LICENSE.txt +340 -340
  101. includes/pum-sdk/freemius/includes/sdk/index.php +2 -2
  102. includes/pum-sdk/freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +43 -47
  103. includes/pum-sdk/freemius/includes/supplements/fs-essential-functions-2.2.1.php +45 -0
  104. includes/pum-sdk/freemius/includes/supplements/index.php +2 -2
  105. includes/pum-sdk/freemius/index.php +2 -2
  106. includes/pum-sdk/freemius/languages/freemius-da_DK.mo +0 -0
  107. includes/pum-sdk/freemius/languages/freemius-da_DK.po +167 -2299
classes/Admin.php CHANGED
@@ -1,91 +1,96 @@
1
- <?php
2
- /*******************************************************************************
3
- * Copyright (c) 2017, WP Popup Maker
4
- ******************************************************************************/
5
-
6
- class PUM_Admin {
7
-
8
- public static function init() {
9
- PUM_Admin_Pages::init();
10
- PUM_Admin_Ajax::init();
11
- PUM_Admin_Assets::init();
12
- PUM_Admin_Popups::init();
13
- PUM_Admin_Themes::init();
14
- PUM_Admin_Subscribers::init();
15
- PUM_Admin_Settings::init();
16
- PUM_Admin_Tools::init();
17
- PUM_Admin_Shortcode_UI::init();
18
- PUM_Upsell::init();
19
-
20
- add_filter( 'user_has_cap', array( __CLASS__, 'prevent_default_theme_deletion' ), 10, 3 );
21
- add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 );
22
- add_action( 'admin_init', array( __CLASS__, 'after_install' ) );
23
- }
24
-
25
- /**
26
- * Prevent user from deleting the current default popup_theme
27
- *
28
- * @param $allcaps
29
- * @param $caps
30
- * @param $args
31
- *
32
- * @return mixed
33
- */
34
- public static function prevent_default_theme_deletion( $allcaps, $caps, $args ) {
35
- global $wpdb;
36
- if ( isset( $args[0] ) && isset( $args[2] ) && $args[2] == pum_get_option( 'default_theme' ) && $args[0] == 'delete_post' ) {
37
- $allcaps[ $caps[0] ] = false;
38
- }
39
-
40
- return $allcaps;
41
- }
42
-
43
- /**
44
- * Render plugin action links.
45
- *
46
- * @param $links
47
- * @param $file
48
- *
49
- * @return mixed
50
- */
51
- public static function plugin_action_links( $links, $file ) {
52
-
53
- if ( $file == plugin_basename( POPMAKE ) ) {
54
- $plugin_action_links = apply_filters( 'pum_plugin_action_links', array(
55
- 'extend' => '<a href="' . admin_url( 'edit.php?post_type=popup&page=pum-extensions' ) . '">' . __( 'Integrations', 'popup-maker' ) . '</a>',
56
- 'settings' => '<a href="' . admin_url( 'edit.php?post_type=popup&page=pum-settings' ) . '">' . __( 'Settings', 'popup-maker' ) . '</a>',
57
- ) );
58
-
59
- foreach ( $plugin_action_links as $link ) {
60
- array_unshift( $links, $link );
61
- }
62
- }
63
-
64
- return $links;
65
- }
66
-
67
- /**
68
- * Post-installation
69
- *
70
- * Runs just after plugin installation and exposes the
71
- * popmake_after_install hook.
72
- *
73
- * @since 1.0
74
- * @return void
75
- */
76
- public static function after_install() {
77
-
78
- if ( ! is_admin() ) {
79
- return;
80
- }
81
-
82
- $already_installed = get_option( '_pum_installed' );
83
-
84
- // Exit if not in admin or the transient doesn't exist
85
- if ( false === $already_installed ) {
86
- do_action( 'pum_after_install' );
87
-
88
- update_option( '_pum_installed', true );
89
- }
90
- }
91
- }
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright (c) 2017, WP Popup Maker
4
+ ******************************************************************************/
5
+
6
+ class PUM_Admin {
7
+
8
+ public static function init() {
9
+ PUM_Admin_Pages::init();
10
+ PUM_Admin_Ajax::init();
11
+ PUM_Admin_Assets::init();
12
+ PUM_Admin_Popups::init();
13
+ PUM_Admin_Themes::init();
14
+ PUM_Admin_Subscribers::init();
15
+ PUM_Admin_Settings::init();
16
+ PUM_Admin_Tools::init();
17
+ PUM_Admin_Shortcode_UI::init();
18
+ PUM_Upsell::init();
19
+
20
+ add_filter( 'user_has_cap', array( __CLASS__, 'prevent_default_theme_deletion' ), 10, 3 );
21
+ add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_action_links' ), 10, 2 );
22
+ add_action( 'admin_init', array( __CLASS__, 'after_install' ) );
23
+ }
24
+
25
+ /**
26
+ * Prevent user from deleting the current default popup_theme
27
+ *
28
+ * @param $allcaps
29
+ * @param $caps
30
+ * @param $args
31
+ *
32
+ * @return mixed
33
+ */
34
+ public static function prevent_default_theme_deletion( $allcaps, $caps, $args ) {
35
+ global $wpdb;
36
+ if ( isset( $args[0] ) && isset( $args[2] ) && $args[2] == pum_get_option( 'default_theme' ) && $args[0] == 'delete_post' ) {
37
+ $allcaps[ $caps[0] ] = false;
38
+ }
39
+
40
+ return $allcaps;
41
+ }
42
+
43
+ /**
44
+ * Render plugin action links.
45
+ *
46
+ * @param $links
47
+ * @param $file
48
+ *
49
+ * @return mixed
50
+ */
51
+ public static function plugin_action_links( $links, $file ) {
52
+
53
+ if ( $file == plugin_basename( POPMAKE ) ) {
54
+ $plugin_action_links = apply_filters( 'pum_plugin_action_links', array(
55
+ 'extend' => '<a href="' . admin_url( 'edit.php?post_type=popup&page=pum-extensions' ) . '">' . __( 'Integrations', 'popup-maker' ) . '</a>',
56
+ 'settings' => '<a href="' . admin_url( 'edit.php?post_type=popup&page=pum-settings' ) . '">' . __( 'Settings', 'popup-maker' ) . '</a>',
57
+ ) );
58
+
59
+ // TODO Rewrite this to take full advantage of our polyglot detection code in Alerts for translation requests.
60
+ if ( substr( get_locale(), 0, 2 ) != 'en' ) {
61
+ $plugin_action_links = array_merge( array( 'translate' => '<a href="' . sprintf( 'https://translate.wordpress.org/locale/%s/default/wp-plugins/popup-maker', substr( get_locale(), 0, 2 ) ) . '" target="_blank">' . __( 'Translate', 'popup-maker' ) . '</a>' ), $plugin_action_links );
62
+ }
63
+
64
+ foreach ( $plugin_action_links as $link ) {
65
+ array_unshift( $links, $link );
66
+ }
67
+ }
68
+
69
+ return $links;
70
+ }
71
+
72
+ /**
73
+ * Post-installation
74
+ *
75
+ * Runs just after plugin installation and exposes the
76
+ * popmake_after_install hook.
77
+ *
78
+ * @since 1.0
79
+ * @return void
80
+ */
81
+ public static function after_install() {
82
+
83
+ if ( ! is_admin() ) {
84
+ return;
85
+ }
86
+
87
+ $already_installed = get_option( '_pum_installed' );
88
+
89
+ // Exit if not in admin or the transient doesn't exist
90
+ if ( false === $already_installed ) {
91
+ do_action( 'pum_after_install' );
92
+
93
+ update_option( '_pum_installed', true );
94
+ }
95
+ }
96
+ }
includes/functions/popups/getters.php CHANGED
@@ -1,42 +1,59 @@
1
- <?php
2
- /*******************************************************************************
3
- * Copyright (c) 2018, WP Popup Maker
4
- ******************************************************************************/
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit; // Exit if accessed directly
8
- }
9
-
10
- /**
11
- * Return the popup id.
12
- *
13
- * @param int $popup_id
14
- *
15
- * @return int
16
- */
17
- function pum_get_popup_id( $popup_id = 0 ) {
18
- if ( ! empty( $popup_id ) && is_numeric( $popup_id ) ) {
19
- $_popup_id = $popup_id;
20
- } elseif ( is_object( pum()->current_popup ) && is_numeric( pum()->current_popup->ID ) ) {
21
- $_popup_id = pum()->current_popup->ID;
22
- } else {
23
- $_popup_id = 0;
24
- }
25
-
26
- return (int) apply_filters( 'pum_get_popup_id', (int) $_popup_id, $popup_id );
27
- }
28
-
29
- /**
30
- * @param int $popup_id
31
- *
32
- * @return string
33
- */
34
- function pum_get_popup_title( $popup_id = 0 ) {
35
- $popup = pum_get_popup( $popup_id );
36
-
37
- if ( ! pum_is_popup_object( $popup ) ) {
38
- return "";
39
- }
40
-
41
- return $popup->get_title();
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright (c) 2018, WP Popup Maker
4
+ ******************************************************************************/
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly
8
+ }
9
+
10
+ /**
11
+ * Return the popup id.
12
+ *
13
+ * @param int $popup_id
14
+ *
15
+ * @return int
16
+ */
17
+ function pum_get_popup_id( $popup_id = 0 ) {
18
+ if ( ! empty( $popup_id ) && is_numeric( $popup_id ) ) {
19
+ $_popup_id = $popup_id;
20
+ } elseif ( is_object( pum()->current_popup ) && is_numeric( pum()->current_popup->ID ) ) {
21
+ $_popup_id = pum()->current_popup->ID;
22
+ } else {
23
+ $_popup_id = 0;
24
+ }
25
+
26
+ return (int) apply_filters( 'pum_get_popup_id', (int) $_popup_id, $popup_id );
27
+ }
28
+
29
+ /**
30
+ * @param int $popup_id
31
+ *
32
+ * @return string
33
+ */
34
+ function pum_get_popup_title( $popup_id = 0 ) {
35
+ $popup = pum_get_popup( $popup_id );
36
+
37
+ if ( ! pum_is_popup_object( $popup ) ) {
38
+ return "";
39
+ }
40
+
41
+ return $popup->get_title();
42
+ }
43
+
44
+ /**
45
+ * @deprecated 1.8.0
46
+ *
47
+ * @param int $popup_id
48
+ *
49
+ * @return array
50
+ */
51
+ function pum_get_popup_triggers( $popup_id = 0 ) {
52
+ $popup = pum_get_popup( $popup_id );
53
+
54
+ if ( ! pum_is_popup_object( $popup ) ) {
55
+ return array();
56
+ }
57
+
58
+ return $popup->get_triggers();
59
+ }
includes/pum-sdk/freemius/LICENSE.txt CHANGED
@@ -1,674 +1,674 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- {one line to give the program's name and a brief idea of what it does.}
635
- Copyright (C) {year} {name of author}
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- {project} Copyright (C) {year} {fullname}
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
includes/pum-sdk/freemius/README.md CHANGED
@@ -1,253 +1,253 @@
1
- Freemius WordPress SDK
2
- ======================
3
-
4
- [Monetization](https://freemius.com/wordpress/), [analytics](https://freemius.com/wordpress/insights/), and marketing automation platform for plugin & theme developers. Freemius empower developers to create prosperous subscription based businesses.
5
-
6
- You can see some of the WordPress.org plugins & themes that are utilizing the power of Freemius here:
7
-
8
- https://includewp.com/freemius/#focus
9
-
10
- If you are a WordPress plugin or theme developer and you are interested to monetize with Freemius you can [sign-up here for free](https://dashboard.freemius.com/register/):
11
-
12
- https://dashboard.freemius.com/register/
13
-
14
- **Below you'll find the integration instructions for our WordPress SDK.**
15
-
16
- ## Code Documentation
17
-
18
- You can find the SDK's PHP-Doc documentation here:
19
- https://codedoc.pub/freemius/wordpress-sdk/master/
20
-
21
- ## Initializing the SDK
22
-
23
- Copy the code below and paste it into the top of your main plugin's PHP file, right after the plugin's header comment:
24
-
25
- ```php
26
- <?php
27
- // Create a helper function for easy SDK access.
28
- function my_prefix_fs() {
29
- global $my_prefix_fs;
30
- if ( ! isset( $my_prefix_fs ) ) {
31
- // Include Freemius SDK.
32
- require_once dirname(__FILE__) . '/freemius/start.php';
33
-
34
- $my_prefix_fs = fs_dynamic_init( array(
35
- 'id' => '1234',
36
- 'slug' => 'my-plugin-slug',
37
- 'menu_slug' => 'my_menu_slug', // You can also use __FILE__
38
- 'public_key' => 'pk_MY_PUBLIC_KEY',
39
- 'is_live' => true,
40
- 'is_premium' => true,
41
- 'has_addons' => false,
42
- 'has_paid_plans' => false,
43
- // Set the SDK to work in a sandbox mode (for development & testing).
44
- // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
45
- 'secret_key' => 'sk_MY_SECRET_KEY',
46
- ) );
47
- }
48
-
49
- return $my_prefix_fs;
50
- }
51
-
52
- // Init Freemius.
53
- my_prefix_fs();
54
- ?>
55
- ```
56
-
57
- - **1234** - Replace with your plugin's ID.
58
- - **pk_MY_PUBLIC_KEY** - Replace with your plugin's public key.
59
- - **sk_MY_SECRET_KEY** - Replace with your plugin's secret key.
60
- - **my-plugin-slug** - Replace with your plugin's WordPress.org slug.
61
- - **my_menu_slug** - Replace with your admin dashboard settings menu slug.
62
-
63
-
64
- ## Usage example
65
-
66
- You can call the SDK by using the shortcode function:
67
-
68
- ```php
69
- <?php my_prefix_fs()->get_upgrade_url(); ?>
70
- ```
71
-
72
- Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
73
-
74
- ```php
75
- <?php
76
- global $my_prefix_fs;
77
- $my_prefix_fs->get_account_url();
78
- ?>
79
- ```
80
-
81
- ## Adding license based logic examples
82
-
83
- Add marketing content to encourage your users to upgrade for your paid version:
84
-
85
- ```php
86
- <?php
87
- if ( my_prefix_fs()->is_not_paying() ) {
88
- echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
89
- echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
90
- esc_html__('Upgrade Now!', 'my-plugin-slug') .
91
- '</a>';
92
- echo '</section>';
93
- }
94
- ?>
95
- ```
96
-
97
- Add logic which will only be available in your premium plugin version:
98
-
99
- ```php
100
- <?php
101
- // This "if" block will be auto removed from the Free version.
102
- if ( my_prefix_fs()->is__premium_only() ) {
103
-
104
- // ... premium only logic ...
105
-
106
- }
107
- ?>
108
- ```
109
-
110
- To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
111
-
112
- ```php
113
- <?php
114
- class My_Plugin {
115
- function init() {
116
- ...
117
-
118
- // This "if" block will be auto removed from the free version.
119
- if ( my_prefix_fs()->is__premium_only() ) {
120
- // Init premium version.
121
- $this->admin_init__premium_only();
122
-
123
- add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
124
- }
125
-
126
- ...
127
- }
128
-
129
- // This method will be only included in the premium version.
130
- function admin_init__premium_only() {
131
- ...
132
- }
133
-
134
- // This method will be only included in the premium version.
135
- function admin_init_hook__premium_only() {
136
- ...
137
- }
138
- }
139
- ?>
140
- ```
141
-
142
- Add logic which will only be executed for customers in your 'professional' plan:
143
-
144
- ```php
145
- <?php
146
- if ( my_prefix_fs()->is_plan('professional', true) ) {
147
- // .. logic related to Professional plan only ...
148
- }
149
- ?>
150
- ```
151
-
152
- Add logic which will only be executed for customers in your 'professional' plan or higher plans:
153
-
154
- ```php
155
- <?php
156
- if ( my_prefix_fs()->is_plan('professional') ) {
157
- // ... logic related to Professional plan and higher plans ...
158
- }
159
- ?>
160
- ```
161
-
162
- Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
163
-
164
- ```php
165
- <?php
166
- // This "if" block will be auto removed from the Free version.
167
- if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
168
- // ... logic related to Professional plan and higher plans ...
169
- }
170
- ?>
171
- ```
172
-
173
- Add logic only for users in trial:
174
-
175
- ```php
176
- <?php
177
- if ( my_prefix_fs()->is_trial() ) {
178
- // ... logic for users in trial ...
179
- }
180
- ?>
181
- ```
182
-
183
- Add logic for specified paid plan:
184
-
185
- ```php
186
- <?php
187
- // This "if" block will be auto removed from the Free version.
188
- if ( my_prefix_fs()->is__premium_only() ) {
189
- if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
190
-
191
- // ... logic related to Professional plan only ...
192
-
193
- } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
194
-
195
- // ... logic related to Business plan and higher plans ...
196
-
197
- }
198
- }
199
- ?>
200
- ```
201
-
202
- ## Excluding files and folders from the free plugin version
203
- There are two ways to exclude files from your free version.
204
-
205
- 1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all type of files, not only PHP.
206
- 2. Add `@fs_premium_only` a sepcial meta tag to the plugin's main PHP file header. Example:
207
- ```php
208
- <?php
209
- /**
210
- * Plugin Name: My Very Awesome Plugin
211
- * Plugin URI: http://my-awesome-plugin.com
212
- * Description: Create and manage Awesomeness right in WordPress.
213
- * Version: 1.0.0
214
- * Author: Awesomattic
215
- * Author URI: http://my-awesome-plugin.com/me/
216
- * License: GPLv2
217
- * Text Domain: myplugin
218
- * Domain Path: /langs
219
- *
220
- * @fs_premium_only /lib/functions.php, /premium-files/
221
- */
222
-
223
- if ( ! defined( 'ABSPATH' ) ) {
224
- exit;
225
- }
226
-
227
- // ... my code ...
228
- ?>
229
- ```
230
- The file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
231
-
232
- # WordPress.org Compliance
233
- Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
234
- > All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
235
-
236
- Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or the other methods provided to exclude premium features & files from the free version.
237
-
238
- ## Deployment
239
- Zip your plugin's root folder and upload it in the Deployment section in the *Freemius Developer's Dashboard*.
240
- The plugin will be scanned and processed by a custom developed *PHP Processor* which will auto-generate two versions of your plugin:
241
-
242
- 1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
243
- 2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
244
-
245
- The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org complaint and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
246
-
247
- ## Reporting Bugs
248
- Email dev [at] freemius [dot] com
249
-
250
- ## FAQ
251
-
252
- ## Copyright
253
- Freemius, Inc.
1
+ Freemius WordPress SDK
2
+ ======================
3
+
4
+ [Monetization](https://freemius.com/wordpress/), [analytics](https://freemius.com/wordpress/insights/), and marketing automation platform for plugin & theme developers. Freemius empower developers to create prosperous subscription based businesses.
5
+
6
+ You can see some of the WordPress.org plugins & themes that are utilizing the power of Freemius here:
7
+
8
+ https://includewp.com/freemius/#focus
9
+
10
+ If you are a WordPress plugin or theme developer and you are interested to monetize with Freemius you can [sign-up here for free](https://dashboard.freemius.com/register/):
11
+
12
+ https://dashboard.freemius.com/register/
13
+
14
+ **Below you'll find the integration instructions for our WordPress SDK.**
15
+
16
+ ## Code Documentation
17
+
18
+ You can find the SDK's PHP-Doc documentation here:
19
+ https://codedoc.pub/freemius/wordpress-sdk/master/
20
+
21
+ ## Initializing the SDK
22
+
23
+ Copy the code below and paste it into the top of your main plugin's PHP file, right after the plugin's header comment:
24
+
25
+ ```php
26
+ <?php
27
+ // Create a helper function for easy SDK access.
28
+ function my_prefix_fs() {
29
+ global $my_prefix_fs;
30
+ if ( ! isset( $my_prefix_fs ) ) {
31
+ // Include Freemius SDK.
32
+ require_once dirname(__FILE__) . '/freemius/start.php';
33
+
34
+ $my_prefix_fs = fs_dynamic_init( array(
35
+ 'id' => '1234',
36
+ 'slug' => 'my-plugin-slug',
37
+ 'menu_slug' => 'my_menu_slug', // You can also use __FILE__
38
+ 'public_key' => 'pk_MY_PUBLIC_KEY',
39
+ 'is_live' => true,
40
+ 'is_premium' => true,
41
+ 'has_addons' => false,
42
+ 'has_paid_plans' => false,
43
+ // Set the SDK to work in a sandbox mode (for development & testing).
44
+ // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
45
+ 'secret_key' => 'sk_MY_SECRET_KEY',
46
+ ) );
47
+ }
48
+
49
+ return $my_prefix_fs;
50
+ }
51
+
52
+ // Init Freemius.
53
+ my_prefix_fs();
54
+ ?>
55
+ ```
56
+
57
+ - **1234** - Replace with your plugin's ID.
58
+ - **pk_MY_PUBLIC_KEY** - Replace with your plugin's public key.
59
+ - **sk_MY_SECRET_KEY** - Replace with your plugin's secret key.
60
+ - **my-plugin-slug** - Replace with your plugin's WordPress.org slug.
61
+ - **my_menu_slug** - Replace with your admin dashboard settings menu slug.
62
+
63
+
64
+ ## Usage example
65
+
66
+ You can call the SDK by using the shortcode function:
67
+
68
+ ```php
69
+ <?php my_prefix_fs()->get_upgrade_url(); ?>
70
+ ```
71
+
72
+ Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
73
+
74
+ ```php
75
+ <?php
76
+ global $my_prefix_fs;
77
+ $my_prefix_fs->get_account_url();
78
+ ?>
79
+ ```
80
+
81
+ ## Adding license based logic examples
82
+
83
+ Add marketing content to encourage your users to upgrade for your paid version:
84
+
85
+ ```php
86
+ <?php
87
+ if ( my_prefix_fs()->is_not_paying() ) {
88
+ echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
89
+ echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
90
+ esc_html__('Upgrade Now!', 'my-plugin-slug') .
91
+ '</a>';
92
+ echo '</section>';
93
+ }
94
+ ?>
95
+ ```
96
+
97
+ Add logic which will only be available in your premium plugin version:
98
+
99
+ ```php
100
+ <?php
101
+ // This "if" block will be auto removed from the Free version.
102
+ if ( my_prefix_fs()->is__premium_only() ) {
103
+
104
+ // ... premium only logic ...
105
+
106
+ }
107
+ ?>
108
+ ```
109
+
110
+ To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
111
+
112
+ ```php
113
+ <?php
114
+ class My_Plugin {
115
+ function init() {
116
+ ...
117
+
118
+ // This "if" block will be auto removed from the free version.
119
+ if ( my_prefix_fs()->is__premium_only() ) {
120
+ // Init premium version.
121
+ $this->admin_init__premium_only();
122
+
123
+ add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
124
+ }
125
+
126
+ ...
127
+ }
128
+
129
+ // This method will be only included in the premium version.
130
+ function admin_init__premium_only() {
131
+ ...
132
+ }
133
+
134
+ // This method will be only included in the premium version.
135
+ function admin_init_hook__premium_only() {
136
+ ...
137
+ }
138
+ }
139
+ ?>
140
+ ```
141
+
142
+ Add logic which will only be executed for customers in your 'professional' plan:
143
+
144
+ ```php
145
+ <?php
146
+ if ( my_prefix_fs()->is_plan('professional', true) ) {
147
+ // .. logic related to Professional plan only ...
148
+ }
149
+ ?>
150
+ ```
151
+
152
+ Add logic which will only be executed for customers in your 'professional' plan or higher plans:
153
+
154
+ ```php
155
+ <?php
156
+ if ( my_prefix_fs()->is_plan('professional') ) {
157
+ // ... logic related to Professional plan and higher plans ...
158
+ }
159
+ ?>
160
+ ```
161
+
162
+ Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
163
+
164
+ ```php
165
+ <?php
166
+ // This "if" block will be auto removed from the Free version.
167
+ if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
168
+ // ... logic related to Professional plan and higher plans ...
169
+ }
170
+ ?>
171
+ ```
172
+
173
+ Add logic only for users in trial:
174
+
175
+ ```php
176
+ <?php
177
+ if ( my_prefix_fs()->is_trial() ) {
178
+ // ... logic for users in trial ...
179
+ }
180
+ ?>
181
+ ```
182
+
183
+ Add logic for specified paid plan:
184
+
185
+ ```php
186
+ <?php
187
+ // This "if" block will be auto removed from the Free version.
188
+ if ( my_prefix_fs()->is__premium_only() ) {
189
+ if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
190
+
191
+ // ... logic related to Professional plan only ...
192
+
193
+ } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
194
+
195
+ // ... logic related to Business plan and higher plans ...
196
+
197
+ }
198
+ }
199
+ ?>
200
+ ```
201
+
202
+ ## Excluding files and folders from the free plugin version
203
+ There are two ways to exclude files from your free version.
204
+
205
+ 1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all type of files, not only PHP.
206
+ 2. Add `@fs_premium_only` a sepcial meta tag to the plugin's main PHP file header. Example:
207
+ ```php
208
+ <?php
209
+ /**
210
+ * Plugin Name: My Very Awesome Plugin
211
+ * Plugin URI: http://my-awesome-plugin.com
212
+ * Description: Create and manage Awesomeness right in WordPress.
213
+ * Version: 1.0.0
214
+ * Author: Awesomattic
215
+ * Author URI: http://my-awesome-plugin.com/me/
216
+ * License: GPLv2
217
+ * Text Domain: myplugin
218
+ * Domain Path: /langs
219
+ *
220
+ * @fs_premium_only /lib/functions.php, /premium-files/
221
+ */
222
+
223
+ if ( ! defined( 'ABSPATH' ) ) {
224
+ exit;
225
+ }
226
+
227
+ // ... my code ...
228
+ ?>
229
+ ```
230
+ The file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
231
+
232
+ # WordPress.org Compliance
233
+ Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
234
+ > All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
235
+
236
+ Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or the other methods provided to exclude premium features & files from the free version.
237
+
238
+ ## Deployment
239
+ Zip your plugin's root folder and upload it in the Deployment section in the *Freemius Developer's Dashboard*.
240
+ The plugin will be scanned and processed by a custom developed *PHP Processor* which will auto-generate two versions of your plugin:
241
+
242
+ 1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
243
+ 2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
244
+
245
+ The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org complaint and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
246
+
247
+ ## Reporting Bugs
248
+ Email dev [at] freemius [dot] com
249
+
250
+ ## FAQ
251
+
252
+ ## Copyright
253
+ Freemius, Inc.
includes/pum-sdk/freemius/assets/css/admin/account.css CHANGED
@@ -1 +1 @@
1
- #fs_account .postbox,#fs_account .widefat{max-width:700px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
1
+ #fs_account .postbox,#fs_account .widefat{max-width:700px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
includes/pum-sdk/freemius/assets/css/admin/add-ons.css CHANGED
@@ -1,2 +1,2 @@
1
- #fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
- #TB_window,#TB_window iframe{width:772px !important}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
1
+ #fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
+ #TB_window,#TB_window iframe{width:772px !important}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
includes/pum-sdk/freemius/assets/css/admin/affiliation.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
1
+ @charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
includes/pum-sdk/freemius/assets/css/admin/checkout.css CHANGED
@@ -1 +1 @@
1
- @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
1
+ @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
includes/pum-sdk/freemius/assets/css/admin/common.css CHANGED
@@ -1,2 +1,2 @@
1
- .theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
- .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("../../../../../../../wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
1
+ .theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#fs_frame{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
+ .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("/wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}.plugins p.fs-upgrade-notice{border:0;background-color:#d54e21;padding:10px;color:#f9f9f9;margin-top:10px}
includes/pum-sdk/freemius/assets/css/admin/connect.css CHANGED
@@ -1 +1 @@
1
- #fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect.require-license-key #sites_list_container td{cursor:pointer}#fs_connect #delegate_to_site_admins{margin-right:15px;float:right;height:26px;vertical-align:middle;line-height:37px;font-weight:bold;border-bottom:1px dashed;text-decoration:none}#fs_connect #delegate_to_site_admins.rtl{margin-left:15px;margin-right:0}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li div{margin-left:55px}#fs_connect .fs-permissions ul li div span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li div p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}#multisite_options_container{margin-top:10px;border:1px solid #ccc;padding:5px}#multisite_options_container a{text-decoration:none}#multisite_options_container a:focus{box-shadow:none}#multisite_options_container a.selected{font-weight:bold}#multisite_options_container.apply-on-all-sites{border:0 none;padding:0}#multisite_options_container.apply-on-all-sites #all_sites_options{border-spacing:0}#multisite_options_container.apply-on-all-sites #all_sites_options td:not(:first-child){display:none}#multisite_options_container #sites_list_container{display:none;overflow:auto}#multisite_options_container #sites_list_container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:rgba(0,0,0,0.8);color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right}.fs-tooltip-trigger .fs-tooltip::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,0.8) transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}#fs_marketing_optin{display:none;margin-top:10px;border:1px solid #ccc;padding:10px;line-height:1.5em}#fs_marketing_optin .fs-message{display:block;margin-bottom:5px;font-size:1.05em;font-weight:600}#fs_marketing_optin.error{border:1px solid #d3135a;background:#fee}#fs_marketing_optin.error .fs-message{color:#d3135a}#fs_marketing_optin .fs-input-container{margin-top:5px}#fs_marketing_optin .fs-input-container label{margin-top:5px;display:block}#fs_marketing_optin .fs-input-container label input{float:left;margin:1px 0 0 0}#fs_marketing_optin .fs-input-container label:first-child{display:block;margin-bottom:2px}#fs_marketing_optin .fs-input-label{display:block;margin-left:20px}#fs_marketing_optin .fs-input-label .underlined{text-decoration:underline}.rtl #fs_marketing_optin .fs-input-container label input{float:right}.rtl #fs_marketing_optin .fs-input-label{margin-left:0;margin-right:20px}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li div{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
1
+ #fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect.require-license-key #sites_list_container td{cursor:pointer}#fs_connect #delegate_to_site_admins{margin-right:15px;float:right;height:26px;vertical-align:middle;line-height:37px;font-weight:bold;border-bottom:1px dashed;text-decoration:none}#fs_connect #delegate_to_site_admins.rtl{margin-left:15px;margin-right:0}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li div{margin-left:55px}#fs_connect .fs-permissions ul li div span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li div p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}#multisite_options_container{margin-top:10px;border:1px solid #ccc;padding:5px}#multisite_options_container a{text-decoration:none}#multisite_options_container a:focus{box-shadow:none}#multisite_options_container a.selected{font-weight:bold}#multisite_options_container.apply-on-all-sites{border:0 none;padding:0}#multisite_options_container.apply-on-all-sites #all_sites_options{border-spacing:0}#multisite_options_container.apply-on-all-sites #all_sites_options td:not(:first-child){display:none}#multisite_options_container #sites_list_container{display:none;overflow:auto}#multisite_options_container #sites_list_container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:rgba(0,0,0,0.8);color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right}.fs-tooltip-trigger .fs-tooltip::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,0.8) transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}#fs_marketing_optin{display:none;margin-top:10px;border:1px solid #ccc;padding:10px;line-height:1.5em}#fs_marketing_optin .fs-message{display:block;margin-bottom:5px;font-size:1.05em;font-weight:600}#fs_marketing_optin.error{border:1px solid #d3135a;background:#fee}#fs_marketing_optin.error .fs-message{color:#d3135a}#fs_marketing_optin .fs-input-container{margin-top:5px}#fs_marketing_optin .fs-input-container label{margin-top:5px;display:block}#fs_marketing_optin .fs-input-container label input{float:left;margin:1px 0 0 0}#fs_marketing_optin .fs-input-container label:first-child{display:block;margin-bottom:2px}#fs_marketing_optin .fs-input-label{display:block;margin-left:20px}#fs_marketing_optin .fs-input-label .underlined{text-decoration:underline}.rtl #fs_marketing_optin .fs-input-container label input{float:right}.rtl #fs_marketing_optin .fs-input-label{margin-left:0;margin-right:20px}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li div{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
includes/pum-sdk/freemius/assets/css/admin/deactivation-feedback.css DELETED
@@ -1 +0,0 @@
1
- .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}.fs-modal .fs-modal-dialog li.reason{margin-bottom:10px}.fs-modal .fs-modal-dialog li.reason .reason-input,.fs-modal .fs-modal-dialog li.reason .internal-message{margin-left:29px}.fs-modal .fs-modal-dialog li.reason label{display:table}.fs-modal .fs-modal-dialog li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body h2{font-size:20px}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}.fs-modal .reason-input,.fs-modal .internal-message{margin:3px 0 3px 22px}.fs-modal .reason-input input,.fs-modal .reason-input textarea,.fs-modal .internal-message input,.fs-modal .internal-message textarea{width:100%}.fs-modal li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}body.has-fs-modal{overflow:hidden}#the-list .deactivate>.fs-slug{display:none}
 
includes/pum-sdk/freemius/assets/css/admin/debug.css CHANGED
@@ -1 +1 @@
1
- .switch{position:relative;display:inline-block;font-size:1.6em;font-weight:bold;color:#ccc;text-shadow:0px 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:4px;background:#ececec;box-shadow:0px 0px 4px rgba(0,0,0,0.1),inset 0px 1px 3px 0px rgba(0,0,0,0.1);cursor:pointer}.switch span{display:inline-block;width:35px;text-transform:uppercase}.switch span.on{color:#6bc406}.switch .toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background:-moz-linear-gradient(top, #ececec 0%, #fff 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));background:-webkit-linear-gradient(top, #ececec 0%, #fff 100%);background:-o-linear-gradient(top, #ececec 0%, #fff 100%);background:-ms-linear-gradient(top, #ececec 0%, #fff 100%);background:linear-gradient(top, #ececec 0%, #fff 100%);box-shadow:inset 0px 1px 0px 0px rgba(255,255,255,0.5);z-index:999;-moz-transition:all 0.15s ease-in-out;-o-transition:all 0.15s ease-in-out;-ms-transition:all 0.15s ease-in-out;-webkit-transition:all 0.15s ease-in-out;transition:all 0.15s ease-in-out}.switch.on .toggle{left:2%}.switch.off .toggle{left:54%}.switch.round{padding:0px 20px;border-radius:40px}.switch.round .toggle{border-radius:40px;width:14px;height:14px}.switch.round.on .toggle{left:3%;background:#6bc406}.switch.round.off .toggle{left:58%}.switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
1
+ .switch{position:relative;display:inline-block;font-size:1.6em;font-weight:bold;color:#ccc;text-shadow:0px 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:4px;background:#ececec;box-shadow:0px 0px 4px rgba(0,0,0,0.1),inset 0px 1px 3px 0px rgba(0,0,0,0.1);cursor:pointer}.switch span{display:inline-block;width:35px;text-transform:uppercase}.switch span.on{color:#6bc406}.switch .toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background:-moz-linear-gradient(top, #ececec 0%, #fff 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));background:-webkit-linear-gradient(top, #ececec 0%, #fff 100%);background:-o-linear-gradient(top, #ececec 0%, #fff 100%);background:-ms-linear-gradient(top, #ececec 0%, #fff 100%);background:linear-gradient(top, #ececec 0%, #fff 100%);box-shadow:inset 0px 1px 0px 0px rgba(255,255,255,0.5);z-index:999;-moz-transition:all 0.15s ease-in-out;-o-transition:all 0.15s ease-in-out;-ms-transition:all 0.15s ease-in-out;-webkit-transition:all 0.15s ease-in-out;transition:all 0.15s ease-in-out}.switch.on .toggle{left:2%}.switch.off .toggle{left:54%}.switch.round{padding:0px 20px;border-radius:40px}.switch.round .toggle{border-radius:40px;width:14px;height:14px}.switch.round.on .toggle{left:3%;background:#6bc406}.switch.round.off .toggle{left:58%}.switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
includes/pum-sdk/freemius/assets/css/admin/dialog-boxes.css CHANGED
@@ -1,2 +1,2 @@
1
- .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}#license_options_container table,#license_options_container table select,#license_options_container table #available_license_key{width:100%}#license_options_container table td:first-child{width:1%}#license_options_container table #other_license_key_container label{position:relative;top:6px;float:left;margin-right:5px}#license_options_container table #other_license_key_container div{overflow:hidden;width:auto;height:30px;display:block;top:2px;position:relative}#license_options_container table #other_license_key_container div input{margin:0}#sites_list_container td{cursor:pointer}#multisite_options_container{margin-top:10px;border:1px solid #ccc;padding:5px}#multisite_options_container a{text-decoration:none}#multisite_options_container a:focus{box-shadow:none}#multisite_options_container a.selected{font-weight:bold}#multisite_options_container.apply-on-all-sites{border:0 none;padding:0}#multisite_options_container.apply-on-all-sites #all_sites_options{border-spacing:0}#multisite_options_container.apply-on-all-sites #all_sites_options td:not(:first-child){display:none}#multisite_options_container #sites_list_container{display:none;overflow:auto}#multisite_options_container #sites_list_container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
2
- .rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}
1
+ .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-header .fs-close .dashicons,.fs-modal .fs-modal-header .fs-close:hover .dashicons{text-decoration:none}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-subscription-cancellation .fs-price-increase-warning{color:red;font-weight:bold;padding:0 25px;margin-bottom:0}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:left;top:5px;position:relative}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label input{float:right}.fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{display:block;margin-left:24px}.rtl .fs-modal.fs-modal-subscription-cancellation ul.subscription-actions label span{margin-left:0;margin-right:24px}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}#license_options_container table,#license_options_container table select,#license_options_container table #available_license_key{width:100%}#license_options_container table td:first-child{width:1%}#license_options_container table #other_license_key_container label{position:relative;top:6px;float:left;margin-right:5px}#license_options_container table #other_license_key_container div{overflow:hidden;width:auto;height:30px;display:block;top:2px;position:relative}#license_options_container table #other_license_key_container div input{margin:0}#sites_list_container td{cursor:pointer}#multisite_options_container{margin-top:10px;border:1px solid #ccc;padding:5px}#multisite_options_container a{text-decoration:none}#multisite_options_container a:focus{box-shadow:none}#multisite_options_container a.selected{font-weight:bold}#multisite_options_container.apply-on-all-sites{border:0 none;padding:0}#multisite_options_container.apply-on-all-sites #all_sites_options{border-spacing:0}#multisite_options_container.apply-on-all-sites #all_sites_options td:not(:first-child){display:none}#multisite_options_container #sites_list_container{display:none;overflow:auto}#multisite_options_container #sites_list_container table td{border-top:1px solid #ccc;padding:4px 2px}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
2
+ .rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}.button-primary.warn{box-shadow:0 1px 0 #d2593c;text-shadow:0 -1px 1px #d2593c,1px 0 1px #d2593c,0 1px 1px #d2593c,-1px 0 1px #d2593c;background:#f56a48;border-color:#ec6544 #d2593c #d2593c}.button-primary.warn:hover{background:#fd6d4a;border-color:#d2593c}.button-primary.warn:focus{box-shadow:0 1px 0 #dd6041,0 0 2px 1px #e4a796}.button-primary.warn:active{background:#dd6041;border-color:#d2593c;box-shadow:inset 0 2px 0 #d2593c}.button-primary.warn.disabled{color:#f5b3a1 !important;background:#e76444 !important;border-color:#d85e40 !important;text-shadow:0 -1px 0 rgba(0,0,0,0.1) !important}
includes/pum-sdk/freemius/assets/css/admin/gdpr-optin-notice.css CHANGED
@@ -1 +1 @@
1
- .fs-notice[data-id^="gdpr_optin_actions"] .underlined{text-decoration:underline}.fs-notice[data-id^="gdpr_optin_actions"] ul .button,.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{vertical-align:middle}.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{display:inline-block;margin-left:3px}
1
+ .fs-notice[data-id^="gdpr_optin_actions"] .underlined{text-decoration:underline}.fs-notice[data-id^="gdpr_optin_actions"] ul .button,.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{vertical-align:middle}.fs-notice[data-id^="gdpr_optin_actions"] ul .action-description{display:inline-block;margin-left:3px}
includes/pum-sdk/freemius/assets/css/admin/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/assets/css/admin/license-activation.css DELETED
@@ -1 +0,0 @@
1
- .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body .license-activation-message{margin:0;display:none}.fs-modal .fs-modal-body input.license_key{width:100%}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}body.has-fs-modal{overflow:hidden}
 
includes/pum-sdk/freemius/assets/css/customizer.css CHANGED
@@ -1 +1 @@
1
- #fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}
1
+ #fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}
includes/pum-sdk/freemius/assets/css/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/assets/img/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/assets/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/assets/js/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/assets/js/nojquery.ba-postmessage.js CHANGED
@@ -1,140 +1,140 @@
1
- /*!
2
- * jQuery postMessage - v0.5 - 9/11/2009
3
- * http://benalman.com/projects/jquery-postmessage-plugin/
4
- *
5
- * Copyright (c) 2009 "Cowboy" Ben Alman
6
- * Dual licensed under the MIT and GPL licenses.
7
- * http://benalman.com/about/license/
8
- *
9
- * Non-jQuery fork by Jeff Lee
10
- *
11
- * This fork consists of the following changes:
12
- * 1. Basic code cleanup and restructuring, for legibility.
13
- * 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
14
- * in terms of both function names and object scope. Scope is specified by
15
- * the the "this" context of NoJQueryPostMessageMixin();
16
- * 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
17
- * at least three different GitHub users requesting the removal of this
18
- * "Opera sniff" on the original project's Issues page, so I figured this
19
- * would be a relatively safe change.
20
- * 4. `postMessage` no longer uses `$.param` to serialize messages that are not
21
- * strings. I actually prefer this structure anyway. `receiveMessage` does
22
- * not implement a corresponding deserialization step, and as such it seems
23
- * cleaner and more symmetric to leave both data serialization and
24
- * deserialization to the client.
25
- * 5. The use of `$.isFunction` is replaced by a functionally-identical check.
26
- * 6. The `$:nomunge` YUI option is no longer necessary.
27
- */
28
-
29
- function NoJQueryPostMessageMixin(postBinding, receiveBinding) {
30
-
31
- var setMessageCallback, unsetMessageCallback, currentMsgCallback,
32
- intervalId, lastHash, cacheBust = 1;
33
-
34
- if (window.postMessage) {
35
-
36
- if (window.addEventListener) {
37
- setMessageCallback = function(callback) {
38
- window.addEventListener('message', callback, false);
39
- }
40
-
41
- unsetMessageCallback = function(callback) {
42
- window.removeEventListener('message', callback, false);
43
- }
44
- } else {
45
- setMessageCallback = function(callback) {
46
- window.attachEvent('onmessage', callback);
47
- }
48
-
49
- unsetMessageCallback = function(callback) {
50
- window.detachEvent('onmessage', callback);
51
- }
52
- }
53
-
54
- this[postBinding] = function(message, targetUrl, target) {
55
- if (!targetUrl) {
56
- return;
57
- }
58
-
59
- // The browser supports window.postMessage, so call it with a targetOrigin
60
- // set appropriately, based on the targetUrl parameter.
61
- target.postMessage( message, targetUrl.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) );
62
- }
63
-
64
- // Since the browser supports window.postMessage, the callback will be
65
- // bound to the actual event associated with window.postMessage.
66
- this[receiveBinding] = function(callback, sourceOrigin, delay) {
67
- // Unbind an existing callback if it exists.
68
- if (currentMsgCallback) {
69
- unsetMessageCallback(currentMsgCallback);
70
- currentMsgCallback = null;
71
- }
72
-
73
- if (!callback) {
74
- return false;
75
- }
76
-
77
- // Bind the callback. A reference to the callback is stored for ease of
78
- // unbinding.
79
- currentMsgCallback = setMessageCallback(function(e) {
80
- switch(Object.prototype.toString.call(sourceOrigin)) {
81
- case '[object String]':
82
- if (sourceOrigin !== e.origin) {
83
- return false;
84
- }
85
- break;
86
- case '[object Function]':
87
- if (sourceOrigin(e.origin)) {
88
- return false;
89
- }
90
- break;
91
- }
92
-
93
- callback(e);
94
- });
95
- };
96
-
97
- } else {
98
-
99
- this[postBinding] = function(message, targetUrl, target) {
100
- if (!targetUrl) {
101
- return;
102
- }
103
-
104
- // The browser does not support window.postMessage, so set the location
105
- // of the target to targetUrl#message. A bit ugly, but it works! A cache
106
- // bust parameter is added to ensure that repeat messages trigger the
107
- // callback.
108
- target.location = targetUrl.replace( /#.*$/, '' ) + '#' + (+new Date) + (cacheBust++) + '&' + message;
109
- }
110
-
111
- // Since the browser sucks, a polling loop will be started, and the
112
- // callback will be called whenever the location.hash changes.
113
- this[receiveBinding] = function(callback, sourceOrigin, delay) {
114
- if (intervalId) {
115
- clearInterval(intervalId);
116
- intervalId = null;
117
- }
118
-
119
- if (callback) {
120
- delay = typeof sourceOrigin === 'number'
121
- ? sourceOrigin
122
- : typeof delay === 'number'
123
- ? delay
124
- : 100;
125
-
126
- intervalId = setInterval(function(){
127
- var hash = document.location.hash,
128
- re = /^#?\d+&/;
129
- if ( hash !== lastHash && re.test( hash ) ) {
130
- lastHash = hash;
131
- callback({ data: hash.replace( re, '' ) });
132
- }
133
- }, delay );
134
- }
135
- };
136
-
137
- }
138
-
139
- return this;
140
  }
1
+ /*!
2
+ * jQuery postMessage - v0.5 - 9/11/2009
3
+ * http://benalman.com/projects/jquery-postmessage-plugin/
4
+ *
5
+ * Copyright (c) 2009 "Cowboy" Ben Alman
6
+ * Dual licensed under the MIT and GPL licenses.
7
+ * http://benalman.com/about/license/
8
+ *
9
+ * Non-jQuery fork by Jeff Lee
10
+ *
11
+ * This fork consists of the following changes:
12
+ * 1. Basic code cleanup and restructuring, for legibility.
13
+ * 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
14
+ * in terms of both function names and object scope. Scope is specified by
15
+ * the the "this" context of NoJQueryPostMessageMixin();
16
+ * 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
17
+ * at least three different GitHub users requesting the removal of this
18
+ * "Opera sniff" on the original project's Issues page, so I figured this
19
+ * would be a relatively safe change.
20
+ * 4. `postMessage` no longer uses `$.param` to serialize messages that are not
21
+ * strings. I actually prefer this structure anyway. `receiveMessage` does
22
+ * not implement a corresponding deserialization step, and as such it seems
23
+ * cleaner and more symmetric to leave both data serialization and
24
+ * deserialization to the client.
25
+ * 5. The use of `$.isFunction` is replaced by a functionally-identical check.
26
+ * 6. The `$:nomunge` YUI option is no longer necessary.
27
+ */
28
+
29
+ function NoJQueryPostMessageMixin(postBinding, receiveBinding) {
30
+
31
+ var setMessageCallback, unsetMessageCallback, currentMsgCallback,
32
+ intervalId, lastHash, cacheBust = 1;
33
+
34
+ if (window.postMessage) {
35
+
36
+ if (window.addEventListener) {
37
+ setMessageCallback = function(callback) {
38
+ window.addEventListener('message', callback, false);
39
+ }
40
+
41
+ unsetMessageCallback = function(callback) {
42
+ window.removeEventListener('message', callback, false);
43
+ }
44
+ } else {
45
+ setMessageCallback = function(callback) {
46
+ window.attachEvent('onmessage', callback);
47
+ }
48
+
49
+ unsetMessageCallback = function(callback) {
50
+ window.detachEvent('onmessage', callback);
51
+ }
52
+ }
53
+
54
+ this[postBinding] = function(message, targetUrl, target) {
55
+ if (!targetUrl) {
56
+ return;
57
+ }
58
+
59
+ // The browser supports window.postMessage, so call it with a targetOrigin
60
+ // set appropriately, based on the targetUrl parameter.
61
+ target.postMessage( message, targetUrl.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) );
62
+ }
63
+
64
+ // Since the browser supports window.postMessage, the callback will be
65
+ // bound to the actual event associated with window.postMessage.
66
+ this[receiveBinding] = function(callback, sourceOrigin, delay) {
67
+ // Unbind an existing callback if it exists.
68
+ if (currentMsgCallback) {
69
+ unsetMessageCallback(currentMsgCallback);
70
+ currentMsgCallback = null;
71
+ }
72
+
73
+ if (!callback) {
74
+ return false;
75
+ }
76
+
77
+ // Bind the callback. A reference to the callback is stored for ease of
78
+ // unbinding.
79
+ currentMsgCallback = setMessageCallback(function(e) {
80
+ switch(Object.prototype.toString.call(sourceOrigin)) {
81
+ case '[object String]':
82
+ if (sourceOrigin !== e.origin) {
83
+ return false;
84
+ }
85
+ break;
86
+ case '[object Function]':
87
+ if (sourceOrigin(e.origin)) {
88
+ return false;
89
+ }
90
+ break;
91
+ }
92
+
93
+ callback(e);
94
+ });
95
+ };
96
+
97
+ } else {
98
+
99
+ this[postBinding] = function(message, targetUrl, target) {
100
+ if (!targetUrl) {
101
+ return;
102
+ }
103
+
104
+ // The browser does not support window.postMessage, so set the location
105
+ // of the target to targetUrl#message. A bit ugly, but it works! A cache
106
+ // bust parameter is added to ensure that repeat messages trigger the
107
+ // callback.
108
+ target.location = targetUrl.replace( /#.*$/, '' ) + '#' + (+new Date) + (cacheBust++) + '&' + message;
109
+ }
110
+
111
+ // Since the browser sucks, a polling loop will be started, and the
112
+ // callback will be called whenever the location.hash changes.
113
+ this[receiveBinding] = function(callback, sourceOrigin, delay) {
114
+ if (intervalId) {
115
+ clearInterval(intervalId);
116
+ intervalId = null;
117
+ }
118
+
119
+ if (callback) {
120
+ delay = typeof sourceOrigin === 'number'
121
+ ? sourceOrigin
122
+ : typeof delay === 'number'
123
+ ? delay
124
+ : 100;
125
+
126
+ intervalId = setInterval(function(){
127
+ var hash = document.location.hash,
128
+ re = /^#?\d+&/;
129
+ if ( hash !== lastHash && re.test( hash ) ) {
130
+ lastHash = hash;
131
+ callback({ data: hash.replace( re, '' ) });
132
+ }
133
+ }, delay );
134
+ }
135
+ };
136
+
137
+ }
138
+
139
+ return this;
140
  }
includes/pum-sdk/freemius/assets/js/nojquery.ba-postmessage.min.js CHANGED
@@ -1,12 +1,12 @@
1
- /*
2
- * nojquery-postmessage by Jeff Lee
3
- * a non-jQuery fork of:
4
- *
5
- * jQuery postMessage - v0.5 - 9/11/2009
6
- * http://benalman.com/projects/jquery-postmessage-plugin/
7
- *
8
- * Copyright (c) 2009 "Cowboy" Ben Alman
9
- * Dual licensed under the MIT and GPL licenses.
10
- * http://benalman.com/about/license/
11
- */
12
  function NoJQueryPostMessageMixin(g,a){var b,h,e,d,f,c=1;if(window.postMessage){if(window.addEventListener){b=function(i){window.addEventListener("message",i,false)};h=function(i){window.removeEventListener("message",i,false)}}else{b=function(i){window.attachEvent("onmessage",i)};h=function(i){window.detachEvent("onmessage",i)}}this[g]=function(i,k,j){if(!k){return}j.postMessage(i,k.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))};this[a]=function(k,j,i){if(e){h(e);e=null}if(!k){return false}e=b(function(l){switch(Object.prototype.toString.call(j)){case"[object String]":if(j!==l.origin){return false}break;case"[object Function]":if(j(l.origin)){return false}break}k(l)})}}else{this[g]=function(i,k,j){if(!k){return}j.location=k.replace(/#.*$/,"")+"#"+(+new Date)+(c++)+"&"+i};this[a]=function(k,j,i){if(d){clearInterval(d);d=null}if(k){i=typeof j==="number"?j:typeof i==="number"?i:100;d=setInterval(function(){var m=document.location.hash,l=/^#?\d+&/;if(m!==f&&l.test(m)){f=m;k({data:m.replace(l,"")})}},i)}}}return this};
1
+ /*
2
+ * nojquery-postmessage by Jeff Lee
3
+ * a non-jQuery fork of:
4
+ *
5
+ * jQuery postMessage - v0.5 - 9/11/2009
6
+ * http://benalman.com/projects/jquery-postmessage-plugin/
7
+ *
8
+ * Copyright (c) 2009 "Cowboy" Ben Alman
9
+ * Dual licensed under the MIT and GPL licenses.
10
+ * http://benalman.com/about/license/
11
+ */
12
  function NoJQueryPostMessageMixin(g,a){var b,h,e,d,f,c=1;if(window.postMessage){if(window.addEventListener){b=function(i){window.addEventListener("message",i,false)};h=function(i){window.removeEventListener("message",i,false)}}else{b=function(i){window.attachEvent("onmessage",i)};h=function(i){window.detachEvent("onmessage",i)}}this[g]=function(i,k,j){if(!k){return}j.postMessage(i,k.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))};this[a]=function(k,j,i){if(e){h(e);e=null}if(!k){return false}e=b(function(l){switch(Object.prototype.toString.call(j)){case"[object String]":if(j!==l.origin){return false}break;case"[object Function]":if(j(l.origin)){return false}break}k(l)})}}else{this[g]=function(i,k,j){if(!k){return}j.location=k.replace(/#.*$/,"")+"#"+(+new Date)+(c++)+"&"+i};this[a]=function(k,j,i){if(d){clearInterval(d);d=null}if(k){i=typeof j==="number"?j:typeof i==="number"?i:100;d=setInterval(function(){var m=document.location.hash,l=/^#?\d+&/;if(m!==f&&l.test(m)){f=m;k({data:m.replace(l,"")})}},i)}}}return this};
includes/pum-sdk/freemius/assets/js/postmessage.js CHANGED
@@ -1,135 +1,135 @@
1
- (function ($, undef) {
2
- var global = this;
3
-
4
- // Namespace.
5
- global.FS = global.FS || {};
6
-
7
- global.FS.PostMessage = function ()
8
- {
9
- var
10
- _is_child = false,
11
- _postman = new NoJQueryPostMessageMixin('postMessage', 'receiveMessage'),
12
- _callbacks = {},
13
- _base_url,
14
- _parent_url = decodeURIComponent(document.location.hash.replace(/^#/, '')),
15
- _parent_subdomain = _parent_url.substring(0, _parent_url.indexOf('/', ('https://' === _parent_url.substring(0, ('https://').length)) ? 8 : 7)),
16
- _init = function () {
17
- _postman.receiveMessage(function (e) {
18
- var data = JSON.parse(e.data);
19
-
20
- if (_callbacks[data.type]) {
21
- for (var i = 0; i < _callbacks[data.type].length; i++) {
22
- // Execute type callbacks.
23
- _callbacks[data.type][i](data.data);
24
- }
25
- }
26
- }, _base_url);
27
- },
28
- _hasParent = ('' !== _parent_url),
29
- $window = $(window),
30
- $html = $('html');
31
-
32
- return {
33
- init : function (url, iframes)
34
- {
35
- _base_url = url;
36
- _init();
37
-
38
- // Automatically receive forward messages.
39
- FS.PostMessage.receiveOnce('forward', function (data){
40
- window.location = data.url;
41
- });
42
-
43
- iframes = iframes || [];
44
-
45
- if (iframes.length > 0) {
46
- $window.on('scroll', function () {
47
- for (var i = 0; i < iframes.length; i++) {
48
- FS.PostMessage.postScroll(iframes[i]);
49
- }
50
- });
51
- }
52
- },
53
- init_child : function ()
54
- {
55
- this.init(_parent_subdomain);
56
-
57
- _is_child = true;
58
-
59
- // Post height of a child right after window is loaded.
60
- $(window).bind('load', function () {
61
- FS.PostMessage.postHeight();
62
-
63
- // Post message that window was loaded.
64
- FS.PostMessage.post('loaded');
65
- });
66
- },
67
- hasParent : function ()
68
- {
69
- return _hasParent;
70
- },
71
- postHeight : function (diff, wrapper) {
72
- diff = diff || 0;
73
- wrapper = wrapper || '#wrap_section';
74
- this.post('height', {
75
- height: diff + $(wrapper).outerHeight(true)
76
- });
77
- },
78
- postScroll : function (iframe) {
79
- this.post('scroll', {
80
- top: $window.scrollTop(),
81
- height: ($window.height() - parseFloat($html.css('paddingTop')) - parseFloat($html.css('marginTop')))
82
- }, iframe);
83
- },
84
- post : function (type, data, iframe)
85
- {
86
- console.debug('PostMessage.post', type);
87
-
88
- if (iframe)
89
- {
90
- // Post to iframe.
91
- _postman.postMessage(JSON.stringify({
92
- type: type,
93
- data: data
94
- }), iframe.src, iframe.contentWindow);
95
- }
96
- else {
97
- // Post to parent.
98
- _postman.postMessage(JSON.stringify({
99
- type: type,
100
- data: data
101
- }), _parent_url, window.parent);
102
- }
103
- },
104
- receive: function (type, callback)
105
- {
106
- console.debug('PostMessage.receive', type);
107
-
108
- if (undef === _callbacks[type])
109
- _callbacks[type] = [];
110
-
111
- _callbacks[type].push(callback);
112
- },
113
- receiveOnce: function (type, callback)
114
- {
115
- if (this.is_set(type))
116
- return;
117
-
118
- this.receive(type, callback);
119
- },
120
- // Check if any callbacks assigned to a specified message type.
121
- is_set: function (type)
122
- {
123
- return (undef != _callbacks[type]);
124
- },
125
- parent_url: function ()
126
- {
127
- return _parent_url;
128
- },
129
- parent_subdomain: function ()
130
- {
131
- return _parent_subdomain;
132
- }
133
- };
134
- }();
135
  })(jQuery);
1
+ (function ($, undef) {
2
+ var global = this;
3
+
4
+ // Namespace.
5
+ global.FS = global.FS || {};
6
+
7
+ global.FS.PostMessage = function ()
8
+ {
9
+ var
10
+ _is_child = false,
11
+ _postman = new NoJQueryPostMessageMixin('postMessage', 'receiveMessage'),
12
+ _callbacks = {},
13
+ _base_url,
14
+ _parent_url = decodeURIComponent(document.location.hash.replace(/^#/, '')),
15
+ _parent_subdomain = _parent_url.substring(0, _parent_url.indexOf('/', ('https://' === _parent_url.substring(0, ('https://').length)) ? 8 : 7)),
16
+ _init = function () {
17
+ _postman.receiveMessage(function (e) {
18
+ var data = JSON.parse(e.data);
19
+
20
+ if (_callbacks[data.type]) {
21
+ for (var i = 0; i < _callbacks[data.type].length; i++) {
22
+ // Execute type callbacks.
23
+ _callbacks[data.type][i](data.data);
24
+ }
25
+ }
26
+ }, _base_url);
27
+ },
28
+ _hasParent = ('' !== _parent_url),
29
+ $window = $(window),
30
+ $html = $('html');
31
+
32
+ return {
33
+ init : function (url, iframes)
34
+ {
35
+ _base_url = url;
36
+ _init();
37
+
38
+ // Automatically receive forward messages.
39
+ FS.PostMessage.receiveOnce('forward', function (data){
40
+ window.location = data.url;
41
+ });
42
+
43
+ iframes = iframes || [];
44
+
45
+ if (iframes.length > 0) {
46
+ $window.on('scroll', function () {
47
+ for (var i = 0; i < iframes.length; i++) {
48
+ FS.PostMessage.postScroll(iframes[i]);
49
+ }
50
+ });
51
+ }
52
+ },
53
+ init_child : function ()
54
+ {
55
+ this.init(_parent_subdomain);
56
+
57
+ _is_child = true;
58
+
59
+ // Post height of a child right after window is loaded.
60
+ $(window).bind('load', function () {
61
+ FS.PostMessage.postHeight();
62
+
63
+ // Post message that window was loaded.
64
+ FS.PostMessage.post('loaded');
65
+ });
66
+ },
67
+ hasParent : function ()
68
+ {
69
+ return _hasParent;
70
+ },
71
+ postHeight : function (diff, wrapper) {
72
+ diff = diff || 0;
73
+ wrapper = wrapper || '#wrap_section';
74
+ this.post('height', {
75
+ height: diff + $(wrapper).outerHeight(true)
76
+ });
77
+ },
78
+ postScroll : function (iframe) {
79
+ this.post('scroll', {
80
+ top: $window.scrollTop(),
81
+ height: ($window.height() - parseFloat($html.css('paddingTop')) - parseFloat($html.css('marginTop')))
82
+ }, iframe);
83
+ },
84
+ post : function (type, data, iframe)
85
+ {
86
+ console.debug('PostMessage.post', type);
87
+
88
+ if (iframe)
89
+ {
90
+ // Post to iframe.
91
+ _postman.postMessage(JSON.stringify({
92
+ type: type,
93
+ data: data
94
+ }), iframe.src, iframe.contentWindow);
95
+ }
96
+ else {
97
+ // Post to parent.
98
+ _postman.postMessage(JSON.stringify({
99
+ type: type,
100
+ data: data
101
+ }), _parent_url, window.parent);
102
+ }
103
+ },
104
+ receive: function (type, callback)
105
+ {
106
+ console.debug('PostMessage.receive', type);
107
+
108
+ if (undef === _callbacks[type])
109
+ _callbacks[type] = [];
110
+
111
+ _callbacks[type].push(callback);
112
+ },
113
+ receiveOnce: function (type, callback)
114
+ {
115
+ if (this.is_set(type))
116
+ return;
117
+
118
+ this.receive(type, callback);
119
+ },
120
+ // Check if any callbacks assigned to a specified message type.
121
+ is_set: function (type)
122
+ {
123
+ return (undef != _callbacks[type]);
124
+ },
125
+ parent_url: function ()
126
+ {
127
+ return _parent_url;
128
+ },
129
+ parent_subdomain: function ()
130
+ {
131
+ return _parent_subdomain;
132
+ }
133
+ };
134
+ }();
135
  })(jQuery);
includes/pum-sdk/freemius/assets/scss/_colors.scss CHANGED
@@ -1,68 +1,79 @@
1
- $menu-hover-color: #333;
2
- $darkest-color: #000;
3
- $fms-live-color: #71ae00;
4
- $fms-test-color: #f7941d;
5
- $fms-link-color: #29abe1;
6
- $fms-link-hover-color: darken(#29abe1, 10%);
7
- $body-bkg: #111;
8
- $special-color: #d3135a;
9
- $body-color: #f1f1f1;
10
- $fms-white: #f1f1f1;
11
- $container-bkg: #222;
12
- $container-bkg-odd: #262626;
13
- $container-border-color: #333;
14
- $table-head-bkg: #333;
15
- $table-head-color: #999;
16
- $info-color: #999;
17
- $error-color: #ff0000;
18
-
19
- $fs-logo-blue-color: #29abe1;
20
- $fs-logo-green-color: #71ae00;
21
- $fs-logo-magenta-color: #d3135a;
22
-
23
- // WordPress colors.
24
- $page-header-bkg: #333;
25
- $page-header-color: $fms-white;
26
- $text-dark-color: #333;
27
- $text-light-color: #666;
28
- $text-lightest-color: #999;
29
-
30
- // Notices.
31
- $wp-notice-success-color: #f7fff7;
32
- $wp-notice-success-dark-color: #46b450;
33
- $wp-notice-error-color: #ffeaea;
34
- $wp-notice-error-dark-color: #dc3232;
35
- $wp-notice-warn-color: #fff8e5;
36
- $wp-notice-warn-dark-color: #ffb900;
37
- $fs-notice-promotion-border-color: #00a0d2;
38
- $fs-notice-promotion-bkg: #f2fcff;
39
-
40
- // WP Buttons.
41
- $button-primary-bkg: #6bc406;
42
- $button-primary-color: $fms-white;
43
- $button-secondary-bkg: #333;
44
- $button-secondary-color: $fms-white;
45
- $featured-color: #6bc406;
46
- $wp-selected-color: #0074a3;
47
-
48
- $wordpress_color: #01749A;
49
- $blogger_color: #ff8100;
50
- $wix_color: #fac102;
51
- $shopify_color: #80d100;
52
- $addthis_color: #fe6d4e;
53
- $tumblr_color: #34506b;
54
- $zepo_color: #00baf2;
55
- $jquery_color: #000919;
56
- $javascript_color: #00baf2;
57
- $squarespace_color: #000;
58
-
59
- $blog_color: #ff6600;
60
- $facebook_color: #3b5998;
61
- $twitter_color: #4099ff;
62
- $linkedin_color: #4875b4;
63
- $youtube_color: #ff3333;
64
- $gplus_color: #c63d2d;
65
-
66
- // Tooltip
67
- $tooltip-color: #fff;
68
- $tooltip-bkg-color: rgba(0,0,0,0.8);
 
 
 
 
 
 
 
 
 
 
 
1
+ $menu-hover-color: #333;
2
+ $darkest-color: #000;
3
+ $fms-live-color: #71ae00;
4
+ $fms-test-color: #f7941d;
5
+ $fms-link-color: #29abe1;
6
+ $fms-link-hover-color: darken(#29abe1, 10%);
7
+ $body-bkg: #111;
8
+ $special-color: #d3135a;
9
+ $body-color: #f1f1f1;
10
+ $fms-white: #f1f1f1;
11
+ $container-bkg: #222;
12
+ $container-bkg-odd: #262626;
13
+ $container-border-color: #333;
14
+ $table-head-bkg: #333;
15
+ $table-head-color: #999;
16
+ $info-color: #999;
17
+ $error-color: #ff0000;
18
+
19
+ $fs-logo-blue-color: #29abe1;
20
+ $fs-logo-green-color: #71ae00;
21
+ $fs-logo-magenta-color: #d3135a;
22
+
23
+ // WordPress colors.
24
+ $page-header-bkg: #333;
25
+ $page-header-color: $fms-white;
26
+ $text-dark-color: #333;
27
+ $text-light-color: #666;
28
+ $text-lightest-color: #999;
29
+
30
+ // Notices.
31
+ $wp-notice-success-color: #f7fff7;
32
+ $wp-notice-success-dark-color: #46b450;
33
+ $wp-notice-error-color: #ffeaea;
34
+ $wp-notice-error-dark-color: #dc3232;
35
+ $wp-notice-warn-color: #fff8e5;
36
+ $wp-notice-warn-dark-color: #ffb900;
37
+ $fs-notice-promotion-border-color: #00a0d2;
38
+ $fs-notice-promotion-bkg: #f2fcff;
39
+
40
+ // WP Buttons.
41
+ $button-primary-bkg: #6bc406;
42
+ $button-primary-color: $fms-white;
43
+ $button-secondary-bkg: #333;
44
+ $button-secondary-color: $fms-white;
45
+ $featured-color: #6bc406;
46
+ $wp-selected-color: #0074a3;
47
+ $wp-button-alert-border-color: #d2593c;
48
+ $wp-button-alert-border-top-color: #ec6544;
49
+ $wp-button-alert-shadow-color: #d2593c;
50
+ $wp-button-alert-focused-shadow1-color: #dd6041;
51
+ $wp-button-alert-focused-shadow2-color: #e4a796;
52
+ $wp-button-alert-background-color: #f56a48;
53
+ $wp-button-alert-hovered-background-color: #fd6d4a;
54
+ $wp-button-alert-active-background-color: #dd6041;
55
+ $wp-button-alert-disabled-color: #f5b3a1;
56
+ $wp-button-alert-disabled-background-color: #e76444;
57
+ $wp-button-alert-disabled-border-color: #d85e40;
58
+
59
+ $wordpress_color: #01749A;
60
+ $blogger_color: #ff8100;
61
+ $wix_color: #fac102;
62
+ $shopify_color: #80d100;
63
+ $addthis_color: #fe6d4e;
64
+ $tumblr_color: #34506b;
65
+ $zepo_color: #00baf2;
66
+ $jquery_color: #000919;
67
+ $javascript_color: #00baf2;
68
+ $squarespace_color: #000;
69
+
70
+ $blog_color: #ff6600;
71
+ $facebook_color: #3b5998;
72
+ $twitter_color: #4099ff;
73
+ $linkedin_color: #4875b4;
74
+ $youtube_color: #ff3333;
75
+ $gplus_color: #c63d2d;
76
+
77
+ // Tooltip
78
+ $tooltip-color: #fff;
79
+ $tooltip-bkg-color: rgba(0,0,0,0.8);
includes/pum-sdk/freemius/assets/scss/_mixins.scss CHANGED
@@ -1,270 +1,270 @@
1
- // ---- CSS3 SASS MIXINS ----
2
- // https://github.com/madr/css3-sass-mixins
3
- //
4
- // Copyright (C) 2011 by Anders Ytterström
5
- //
6
- // Permission is hereby granted, free of charge, to any person obtaining a copy
7
- // of this software and associated documentation files (the "Software"), to deal
8
- // in the Software without restriction, including without limitation the rights
9
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- // copies of the Software, and to permit persons to whom the Software is
11
- // furnished to do so, subject to the following conditions:
12
- //
13
- // The above copyright notice and this permission notice shall be included in
14
- // all copies or substantial portions of the Software.
15
- //
16
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- // THE SOFTWARE.
23
- //
24
-
25
- // ---- LEGACY IE SUPPORT USING FILTERS ----
26
- // Should IE filters be used or not?
27
- // PROS: gradients, drop shadows etc will be handled by css.
28
- // CONS: will harm the site performance badly,
29
- // especially on sites with heavy rendering and scripting.
30
- $useIEFilters: 0;
31
- // might be 0 or 1. disabled by default.
32
- // ---- /LEGACY IE SUPPORT USING FILTERS ----
33
-
34
-
35
- @mixin background-size ($value) {
36
- -webkit-background-size: $value;
37
- background-size: $value;
38
- }
39
-
40
- @mixin border-image ($path, $offsets, $repeats) {
41
- -moz-border-image: $path $offsets $repeats;
42
- -o-border-image: $path $offsets $repeats;
43
- -webkit-border-image: $path $offsets $repeats;
44
- border-image: $path $offsets $repeats;
45
- }
46
-
47
- @mixin border-radius ($values...) {
48
- -moz-border-radius: $values;
49
- -webkit-border-radius: $values;
50
- border-radius: $values;
51
- /*-moz-background-clip: padding;
52
- -webkit-background-clip: padding-box;
53
- background-clip: padding-box;*/
54
- }
55
-
56
- @mixin box-shadow ($values...) {
57
- -moz-box-shadow: $values;
58
- -webkit-box-shadow: $values;
59
- box-shadow: $values;
60
- }
61
-
62
- //@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
63
- // -moz-box-shadow: $x $y $offset $spread $hex $inset;
64
- // -webkit-box-shadow: $x $y $offset $spread $hex $inset;
65
- // box-shadow: $x $y $offset $spread $hex $inset;
66
- //
67
- // @if $ie == 1 {
68
- // $iecolor: '#' + red($hex) + green($hex) + blue($hex);
69
- // filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
70
- // -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
71
- // }
72
- //}
73
-
74
- @mixin box-sizing($value) {
75
- -moz-box-sizing: $value;
76
- -webkit-box-sizing: $value;
77
- box-sizing: $value;
78
- }
79
-
80
- // requires sass 3.2
81
- @mixin keyframes($name){
82
- @-moz-keyframes #{$name} { @content; }
83
- @-ms-keyframes #{$name} { @content; }
84
- @-o-keyframes #{$name} { @content; }
85
- @-webkit-keyframes #{$name} { @content; }
86
- @keyframes #{$name} { @content; }
87
- }
88
-
89
- @mixin linear-gradient($from, $to, $ie: $useIEFilters) {
90
- @if $ie != 1 { background-color: $to; }
91
-
92
- background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
93
- background-image: -webkit-linear-gradient(top, $from, $to);
94
- background-image: -moz-linear-gradient(top, $from, $to);
95
- background-image: -ms-linear-gradient(top, $from, $to);
96
- background-image: -o-linear-gradient(top, $from, $to);
97
- background-image: linear-gradient(top, bottom, $from, $to);
98
-
99
- @if $ie == 1 {
100
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
101
- }
102
- }
103
-
104
- @mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
105
- @if $ie != 1 { background-color: $endColor; }
106
-
107
- background-color: $endColor;
108
- background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
109
- background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
110
- background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
111
- background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
112
- background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
113
- background-repeat: repeat-x;
114
- @if $ie == 1 {
115
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
116
- }
117
- }
118
-
119
- @mixin radial-gradient($from, $to, $ie: $useIEFilters) {
120
- @if $ie != 1 { background-color: $to; }
121
-
122
- background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
123
- background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
124
- background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
125
- background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
126
- background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
127
- background: radial-gradient(center, circle cover, $from 0%, $to 100%);
128
- background-color: $from;
129
-
130
- @if $ie == 1 {
131
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
132
- }
133
- }
134
-
135
- @mixin perspective($perspective) {
136
- -moz-perspective: $perspective;
137
- -ms-perspective: $perspective;
138
- -webkit-perspective: $perspective;
139
- perspective: $perspective;
140
- -moz-transform-style: preserve-3d;
141
- -ms-transform-style: preserve-3d;
142
- -webkit-transform-style: preserve-3d;
143
- transform-style: preserve-3d;
144
- }
145
-
146
- @mixin transform ($transforms) {
147
- -moz-transform: $transforms;
148
- -o-transform: $transforms;
149
- -ms-transform: $transforms;
150
- -webkit-transform: $transforms;
151
- transform: $transforms;
152
- }
153
-
154
- @mixin matrix ($a, $b, $c, $d, $e, $f) {
155
- -moz-transform: matrix($a, $b, $c, $d, #{$e}px, #{$f}px);
156
- -o-transform: matrix($a, $b, $c, $d, $e, $f);
157
- -ms-transform: matrix($a, $b, $c, $d, $e, $f);
158
- -webkit-transform: matrix($a, $b, $c, $d, $e, $f);
159
- transform: matrix($a, $b, $c, $d, $e, $f);
160
- }
161
-
162
- @mixin rotate ($deg) {
163
- @include transform(rotate(#{$deg}deg));
164
- }
165
-
166
- @mixin scale ($size) {
167
- @include transform(scale(#{$size}));
168
- }
169
-
170
- @mixin translate ($x, $y) {
171
- @include transform(translate($x, $y));
172
- }
173
-
174
- @mixin transition ($value...) {
175
- -moz-transition: $value;
176
- -o-transition: $value;
177
- -ms-transition: $value;
178
- -webkit-transition: $value;
179
- transition: $value;
180
- }
181
-
182
- @mixin animation($str) {
183
- -webkit-animation: #{$str};
184
- -moz-animation: #{$str};
185
- -ms-animation: #{$str};
186
- -o-animation: #{$str};
187
- animation: #{$str};
188
- }
189
-
190
- @mixin animation-name($str) {
191
- -webkit-animation-name: #{$str};
192
- -moz-animation-name: #{$str};
193
- -ms-animation-name: #{$str};
194
- -o-animation-name: #{$str};
195
- animation-name: #{$str};
196
- }
197
-
198
- @mixin animation-duration($str) {
199
- -webkit-animation-duration: #{$str};
200
- -moz-animation-duration: #{$str};
201
- -ms-animation-duration: #{$str};
202
- -o-animation-duration: #{$str};
203
- animation-duration: #{$str};
204
- }
205
-
206
- @mixin animation-direction($str) {
207
- -webkit-animation-direction: #{$str};
208
- -moz-animation-direction: #{$str};
209
- -ms-animation-direction: #{$str};
210
- -o-animation-direction: #{$str};
211
- animation-direction: #{$str};
212
- }
213
-
214
- @mixin animation-delay($str) {
215
- animation-delay:#{$str};
216
- -o-animation-delay:#{$str};
217
- -ms-animation-delay:#{$str};
218
- -webkit-animation-delay:#{$str};
219
- -moz-animation-delay:#{$str};
220
- }
221
-
222
- @mixin animation-iteration-count($str) {
223
- animation-iteration-count:#{$str};
224
- -o-animation-iteration-count:#{$str};
225
- -ms-animation-iteration-count:#{$str};
226
- -webkit-animation-iteration-count:#{$str};
227
- -moz-animation-iteration-count:#{$str};
228
- }
229
-
230
- @mixin animation-timing-function($str) {
231
- -webkit-animation-timing-function: #{$str};
232
- -moz-animation-timing-function: #{$str};
233
- -ms-animation-timing-function: #{$str};
234
- -o-animation-timing-function: #{$str};
235
- animation-timing-function: #{$str};
236
- }
237
-
238
- // ==== /CSS3 SASS MIXINS ====
239
-
240
- @mixin opacity($opacity) {
241
- opacity: $opacity;
242
- $opacity-ie: $opacity * 100;
243
- filter: alpha(opacity=$opacity-ie); //IE8
244
- }
245
-
246
- @mixin size($width, $height: $width)
247
- {
248
- width: $width;
249
- height: $height;
250
- }
251
-
252
- @mixin clearfix
253
- {
254
- &:after {
255
- content: "";
256
- display: table;
257
- clear: both;
258
- }
259
- }
260
-
261
- // Placeholder text
262
- @mixin placeholder($color: $input-color-placeholder) {
263
- // Firefox
264
- &::-moz-placeholder {
265
- color: $color;
266
- opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
267
- }
268
- &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
269
- &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
270
  }
1
+ // ---- CSS3 SASS MIXINS ----
2
+ // https://github.com/madr/css3-sass-mixins
3
+ //
4
+ // Copyright (C) 2011 by Anders Ytterström
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ // of this software and associated documentation files (the "Software"), to deal
8
+ // in the Software without restriction, including without limitation the rights
9
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ // copies of the Software, and to permit persons to whom the Software is
11
+ // furnished to do so, subject to the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be included in
14
+ // all copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ // THE SOFTWARE.
23
+ //
24
+
25
+ // ---- LEGACY IE SUPPORT USING FILTERS ----
26
+ // Should IE filters be used or not?
27
+ // PROS: gradients, drop shadows etc will be handled by css.
28
+ // CONS: will harm the site performance badly,
29
+ // especially on sites with heavy rendering and scripting.
30
+ $useIEFilters: 0;
31
+ // might be 0 or 1. disabled by default.
32
+ // ---- /LEGACY IE SUPPORT USING FILTERS ----
33
+
34
+
35
+ @mixin background-size ($value) {
36
+ -webkit-background-size: $value;
37
+ background-size: $value;
38
+ }
39
+
40
+ @mixin border-image ($path, $offsets, $repeats) {
41
+ -moz-border-image: $path $offsets $repeats;
42
+ -o-border-image: $path $offsets $repeats;
43
+ -webkit-border-image: $path $offsets $repeats;
44
+ border-image: $path $offsets $repeats;
45
+ }
46
+
47
+ @mixin border-radius ($values...) {
48
+ -moz-border-radius: $values;
49
+ -webkit-border-radius: $values;
50
+ border-radius: $values;
51
+ /*-moz-background-clip: padding;
52
+ -webkit-background-clip: padding-box;
53
+ background-clip: padding-box;*/
54
+ }
55
+
56
+ @mixin box-shadow ($values...) {
57
+ -moz-box-shadow: $values;
58
+ -webkit-box-shadow: $values;
59
+ box-shadow: $values;
60
+ }
61
+
62
+ //@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
63
+ // -moz-box-shadow: $x $y $offset $spread $hex $inset;
64
+ // -webkit-box-shadow: $x $y $offset $spread $hex $inset;
65
+ // box-shadow: $x $y $offset $spread $hex $inset;
66
+ //
67
+ // @if $ie == 1 {
68
+ // $iecolor: '#' + red($hex) + green($hex) + blue($hex);
69
+ // filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
70
+ // -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
71
+ // }
72
+ //}
73
+
74
+ @mixin box-sizing($value) {
75
+ -moz-box-sizing: $value;
76
+ -webkit-box-sizing: $value;
77
+ box-sizing: $value;
78
+ }
79
+
80
+ // requires sass 3.2
81
+ @mixin keyframes($name){
82
+ @-moz-keyframes #{$name} { @content; }
83
+ @-ms-keyframes #{$name} { @content; }
84
+ @-o-keyframes #{$name} { @content; }
85
+ @-webkit-keyframes #{$name} { @content; }
86
+ @keyframes #{$name} { @content; }
87
+ }
88
+
89
+ @mixin linear-gradient($from, $to, $ie: $useIEFilters) {
90
+ @if $ie != 1 { background-color: $to; }
91
+
92
+ background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
93
+ background-image: -webkit-linear-gradient(top, $from, $to);
94
+ background-image: -moz-linear-gradient(top, $from, $to);
95
+ background-image: -ms-linear-gradient(top, $from, $to);
96
+ background-image: -o-linear-gradient(top, $from, $to);
97
+ background-image: linear-gradient(top, bottom, $from, $to);
98
+
99
+ @if $ie == 1 {
100
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
101
+ }
102
+ }
103
+
104
+ @mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
105
+ @if $ie != 1 { background-color: $endColor; }
106
+
107
+ background-color: $endColor;
108
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
109
+ background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
110
+ background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
111
+ background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
112
+ background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
113
+ background-repeat: repeat-x;
114
+ @if $ie == 1 {
115
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
116
+ }
117
+ }
118
+
119
+ @mixin radial-gradient($from, $to, $ie: $useIEFilters) {
120
+ @if $ie != 1 { background-color: $to; }
121
+
122
+ background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
123
+ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
124
+ background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
125
+ background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
126
+ background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
127
+ background: radial-gradient(center, circle cover, $from 0%, $to 100%);
128
+ background-color: $from;
129
+
130
+ @if $ie == 1 {
131
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
132
+ }
133
+ }
134
+
135
+ @mixin perspective($perspective) {
136
+ -moz-perspective: $perspective;
137
+ -ms-perspective: $perspective;
138
+ -webkit-perspective: $perspective;
139
+ perspective: $perspective;
140
+ -moz-transform-style: preserve-3d;
141
+ -ms-transform-style: preserve-3d;
142
+ -webkit-transform-style: preserve-3d;
143
+ transform-style: preserve-3d;
144
+ }
145
+
146
+ @mixin transform ($transforms) {
147
+ -moz-transform: $transforms;
148
+ -o-transform: $transforms;
149
+ -ms-transform: $transforms;
150
+ -webkit-transform: $transforms;
151
+ transform: $transforms;
152
+ }
153
+
154
+ @mixin matrix ($a, $b, $c, $d, $e, $f) {
155
+ -moz-transform: matrix($a, $b, $c, $d, #{$e}px, #{$f}px);
156
+ -o-transform: matrix($a, $b, $c, $d, $e, $f);
157
+ -ms-transform: matrix($a, $b, $c, $d, $e, $f);
158
+ -webkit-transform: matrix($a, $b, $c, $d, $e, $f);
159
+ transform: matrix($a, $b, $c, $d, $e, $f);
160
+ }
161
+
162
+ @mixin rotate ($deg) {
163
+ @include transform(rotate(#{$deg}deg));
164
+ }
165
+
166
+ @mixin scale ($size) {
167
+ @include transform(scale(#{$size}));
168
+ }
169
+
170
+ @mixin translate ($x, $y) {
171
+ @include transform(translate($x, $y));
172
+ }
173
+
174
+ @mixin transition ($value...) {
175
+ -moz-transition: $value;
176
+ -o-transition: $value;
177
+ -ms-transition: $value;
178
+ -webkit-transition: $value;
179
+ transition: $value;
180
+ }
181
+
182
+ @mixin animation($str) {
183
+ -webkit-animation: #{$str};
184
+ -moz-animation: #{$str};
185
+ -ms-animation: #{$str};
186
+ -o-animation: #{$str};
187
+ animation: #{$str};
188
+ }
189
+
190
+ @mixin animation-name($str) {
191
+ -webkit-animation-name: #{$str};
192
+ -moz-animation-name: #{$str};
193
+ -ms-animation-name: #{$str};
194
+ -o-animation-name: #{$str};
195
+ animation-name: #{$str};
196
+ }
197
+
198
+ @mixin animation-duration($str) {
199
+ -webkit-animation-duration: #{$str};
200
+ -moz-animation-duration: #{$str};
201
+ -ms-animation-duration: #{$str};
202
+ -o-animation-duration: #{$str};
203
+ animation-duration: #{$str};
204
+ }
205
+
206
+ @mixin animation-direction($str) {
207
+ -webkit-animation-direction: #{$str};
208
+ -moz-animation-direction: #{$str};
209
+ -ms-animation-direction: #{$str};
210
+ -o-animation-direction: #{$str};
211
+ animation-direction: #{$str};
212
+ }
213
+
214
+ @mixin animation-delay($str) {
215
+ animation-delay:#{$str};
216
+ -o-animation-delay:#{$str};
217
+ -ms-animation-delay:#{$str};
218
+ -webkit-animation-delay:#{$str};
219
+ -moz-animation-delay:#{$str};
220
+ }
221
+
222
+ @mixin animation-iteration-count($str) {
223
+ animation-iteration-count:#{$str};
224
+ -o-animation-iteration-count:#{$str};
225
+ -ms-animation-iteration-count:#{$str};
226
+ -webkit-animation-iteration-count:#{$str};
227
+ -moz-animation-iteration-count:#{$str};
228
+ }
229
+
230
+ @mixin animation-timing-function($str) {
231
+ -webkit-animation-timing-function: #{$str};
232
+ -moz-animation-timing-function: #{$str};
233
+ -ms-animation-timing-function: #{$str};
234
+ -o-animation-timing-function: #{$str};
235
+ animation-timing-function: #{$str};
236
+ }
237
+
238
+ // ==== /CSS3 SASS MIXINS ====
239
+
240
+ @mixin opacity($opacity) {
241
+ opacity: $opacity;
242
+ $opacity-ie: $opacity * 100;
243
+ filter: alpha(opacity=$opacity-ie); //IE8
244
+ }
245
+
246
+ @mixin size($width, $height: $width)
247
+ {
248
+ width: $width;
249
+ height: $height;
250
+ }
251
+
252
+ @mixin clearfix
253
+ {
254
+ &:after {
255
+ content: "";
256
+ display: table;
257
+ clear: both;
258
+ }
259
+ }
260
+
261
+ // Placeholder text
262
+ @mixin placeholder($color: $input-color-placeholder) {
263
+ // Firefox
264
+ &::-moz-placeholder {
265
+ color: $color;
266
+ opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
267
+ }
268
+ &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
269
+ &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
270
  }
includes/pum-sdk/freemius/assets/scss/admin/_ajax-loader.scss CHANGED
@@ -1,49 +1,49 @@
1
- $color: $wp-selected-color;
2
- $bkg-color: #fff;
3
- $size: 20;
4
-
5
- .fs-ajax-loader
6
- {
7
- position: relative;
8
- width: #{8*$size + 10}px;
9
- height: #{$size}px;
10
- margin: auto;
11
-
12
- .fs-ajax-loader-bar
13
- {
14
- position: absolute;
15
- top: 0;
16
- background-color: $color;
17
- width: #{$size}px;
18
- height: #{$size}px;
19
- @include animation-name(bounce_ajaxLoader);
20
- @include animation-duration(1.5s);
21
- @include animation-iteration-count(infinite);
22
- @include animation-direction(normal);
23
- @include transform(.3);
24
- }
25
-
26
- @for $i from 0 through 7
27
- {
28
- .fs-ajax-loader-bar-#{$i + 1}
29
- {
30
- left: #{$i*($size - 1)}px;
31
- @include animation-delay(#{0.6 + $i*0.15}s);
32
- }
33
- }
34
- }
35
-
36
- @include keyframes(bounce_ajaxLoader)
37
- {
38
- 0%
39
- {
40
- @include transform(scale(1));
41
- background-color: $color;
42
- }
43
-
44
- 100%
45
- {
46
- @include transform(scale(.3));
47
- background-color: $bkg-color;
48
- }
49
  }
1
+ $color: $wp-selected-color;
2
+ $bkg-color: #fff;
3
+ $size: 20;
4
+
5
+ .fs-ajax-loader
6
+ {
7
+ position: relative;
8
+ width: #{8*$size + 10}px;
9
+ height: #{$size}px;
10
+ margin: auto;
11
+
12
+ .fs-ajax-loader-bar
13
+ {
14
+ position: absolute;
15
+ top: 0;
16
+ background-color: $color;
17
+ width: #{$size}px;
18
+ height: #{$size}px;
19
+ @include animation-name(bounce_ajaxLoader);
20
+ @include animation-duration(1.5s);
21
+ @include animation-iteration-count(infinite);
22
+ @include animation-direction(normal);
23
+ @include transform(.3);
24
+ }
25
+
26
+ @for $i from 0 through 7
27
+ {
28
+ .fs-ajax-loader-bar-#{$i + 1}
29
+ {
30
+ left: #{$i*($size - 1)}px;
31
+ @include animation-delay(#{0.6 + $i*0.15}s);
32
+ }
33
+ }
34
+ }
35
+
36
+ @include keyframes(bounce_ajaxLoader)
37
+ {
38
+ 0%
39
+ {
40
+ @include transform(scale(1));
41
+ background-color: $color;
42
+ }
43
+
44
+ 100%
45
+ {
46
+ @include transform(scale(.3));
47
+ background-color: $bkg-color;
48
+ }
49
  }
includes/pum-sdk/freemius/assets/scss/admin/_auto-install.scss CHANGED
@@ -1,33 +1,33 @@
1
- .fs-modal-auto-install
2
- {
3
- $max-width: 300px;
4
-
5
- #request-filesystem-credentials-form
6
- {
7
- h2,
8
- .request-filesystem-credentials-action-buttons
9
- {
10
- display: none;
11
- }
12
-
13
- input[type=password],
14
- input[type=email],
15
- input[type=text]
16
- {
17
- -webkit-appearance: none;
18
- padding: 10px 10px 5px 10px;
19
- width: $max-width;
20
- max-width: 100%;
21
- }
22
-
23
- > div,
24
- label,
25
- fieldset
26
- {
27
- width: $max-width;
28
- max-width: 100%;
29
- margin: 0 auto;
30
- display: block;
31
- }
32
- }
33
  }
1
+ .fs-modal-auto-install
2
+ {
3
+ $max-width: 300px;
4
+
5
+ #request-filesystem-credentials-form
6
+ {
7
+ h2,
8
+ .request-filesystem-credentials-action-buttons
9
+ {
10
+ display: none;
11
+ }
12
+
13
+ input[type=password],
14
+ input[type=email],
15
+ input[type=text]
16
+ {
17
+ -webkit-appearance: none;
18
+ padding: 10px 10px 5px 10px;
19
+ width: $max-width;
20
+ max-width: 100%;
21
+ }
22
+
23
+ > div,
24
+ label,
25
+ fieldset
26
+ {
27
+ width: $max-width;
28
+ max-width: 100%;
29
+ margin: 0 auto;
30
+ display: block;
31
+ }
32
+ }
33
  }
includes/pum-sdk/freemius/assets/scss/admin/_buttons.scss ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .button-primary.warn {
2
+ box-shadow: 0 1px 0 $wp-button-alert-shadow-color;
3
+ text-shadow: 0 -1px 1px $wp-button-alert-shadow-color, 1px 0 1px $wp-button-alert-shadow-color, 0 1px 1px $wp-button-alert-shadow-color, -1px 0 1px $wp-button-alert-shadow-color;
4
+ background: $wp-button-alert-background-color;
5
+ border-color: $wp-button-alert-border-top-color $wp-button-alert-border-color $wp-button-alert-border-color;
6
+
7
+ &:hover {
8
+ background: $wp-button-alert-hovered-background-color;
9
+ border-color: $wp-button-alert-border-color;
10
+ }
11
+
12
+ &:focus {
13
+ box-shadow: 0 1px 0 $wp-button-alert-focused-shadow1-color, 0 0 2px 1px $wp-button-alert-focused-shadow2-color;
14
+ }
15
+
16
+ &:active {
17
+ background: $wp-button-alert-active-background-color;
18
+ border-color: $wp-button-alert-border-color;
19
+ box-shadow: inset 0 2px 0 $wp-button-alert-shadow-color;
20
+ }
21
+
22
+ &.disabled {
23
+ color: $wp-button-alert-disabled-color !important;
24
+ background: $wp-button-alert-disabled-background-color !important;
25
+ border-color: $wp-button-alert-disabled-border-color !important;
26
+ text-shadow: 0 -1px 0 rgba(0,0,0,.1) !important;
27
+ }
28
+ }
includes/pum-sdk/freemius/assets/scss/admin/_deactivation-feedback.scss CHANGED
@@ -1,55 +1,55 @@
1
- @import "../colors";
2
-
3
- .fs-modal.fs-modal-deactivation-feedback {
4
- .reason-input, .internal-message {
5
- margin: 3px 0 3px 22px;
6
-
7
- input, textarea {
8
- width: 100%;
9
- }
10
- }
11
-
12
- li.reason {
13
- &.has-internal-message .internal-message {
14
- border: 1px solid lighten($darkest-color, 80%);
15
- padding: 7px;
16
- display: none;
17
- }
18
-
19
- @media (max-width: 650px) {
20
- li.reason {
21
- margin-bottom: 10px;
22
-
23
- .reason-input, .internal-message {
24
- margin-left: 29px;
25
- }
26
-
27
- label {
28
- display: table;
29
-
30
- > span {
31
- display: table-cell;
32
- font-size: 1.3em;
33
- }
34
- }
35
- }
36
- }
37
- }
38
-
39
- .anonymous-feedback-label {
40
- float: left;
41
- }
42
-
43
- .fs-modal-panel {
44
- margin-top: 0 !important;
45
-
46
- h3 {
47
- margin-top: 0;
48
- line-height: 1.5em;
49
- }
50
- }
51
- }
52
-
53
- #the-list .deactivate > .fs-slug {
54
- display: none;
55
  }
1
+ @import "../colors";
2
+
3
+ .fs-modal.fs-modal-deactivation-feedback {
4
+ .reason-input, .internal-message {
5
+ margin: 3px 0 3px 22px;
6
+
7
+ input, textarea {
8
+ width: 100%;
9
+ }
10
+ }
11
+
12
+ li.reason {
13
+ &.has-internal-message .internal-message {
14
+ border: 1px solid lighten($darkest-color, 80%);
15
+ padding: 7px;
16
+ display: none;
17
+ }
18
+
19
+ @media (max-width: 650px) {
20
+ li.reason {
21
+ margin-bottom: 10px;
22
+
23
+ .reason-input, .internal-message {
24
+ margin-left: 29px;
25
+ }
26
+
27
+ label {
28
+ display: table;
29
+
30
+ > span {
31
+ display: table-cell;
32
+ font-size: 1.3em;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+
39
+ .anonymous-feedback-label {
40
+ float: left;
41
+ }
42
+
43
+ .fs-modal-panel {
44
+ margin-top: 0 !important;
45
+
46
+ h3 {
47
+ margin-top: 0;
48
+ line-height: 1.5em;
49
+ }
50
+ }
51
+ }
52
+
53
+ #the-list .deactivate > .fs-slug {
54
+ display: none;
55
  }
includes/pum-sdk/freemius/assets/scss/admin/_gdpr-consent.scss CHANGED
@@ -1,81 +1,81 @@
1
- #fs_marketing_optin
2
- {
3
- display: none;
4
- margin-top: 10px;
5
- border: 1px solid #ccc;
6
- padding: 10px;
7
- line-height: 1.5em;
8
-
9
- .fs-message
10
- {
11
- display: block;
12
- margin-bottom: 5px;
13
- font-size: 1.05em;
14
- font-weight: 600;
15
- }
16
-
17
- &.error
18
- {
19
- border: 1px solid $fs-logo-magenta-color;
20
- background: #fee;
21
-
22
- .fs-message
23
- {
24
- color: $fs-logo-magenta-color;
25
- }
26
- }
27
-
28
- .fs-input-container
29
- {
30
- margin-top: 5px;
31
-
32
- label
33
- {
34
- margin-top: 5px;
35
- display: block;
36
-
37
- input
38
- {
39
- float: left;
40
- margin: 1px 0 0 0;
41
- }
42
-
43
- &:first-child
44
- {
45
- display: block;
46
- margin-bottom: 2px;
47
- }
48
- }
49
- }
50
-
51
- .fs-input-label
52
- {
53
- display: block;
54
- margin-left: 20px;
55
-
56
- .underlined
57
- {
58
- text-decoration: underline;
59
- }
60
- }
61
- }
62
-
63
- .rtl
64
- {
65
- #fs_marketing_optin
66
- {
67
- .fs-input-container
68
- {
69
- label input
70
- {
71
- float: right;
72
- }
73
- }
74
-
75
- .fs-input-label
76
- {
77
- margin-left: 0;
78
- margin-right: 20px;
79
- }
80
- }
81
  }
1
+ #fs_marketing_optin
2
+ {
3
+ display: none;
4
+ margin-top: 10px;
5
+ border: 1px solid #ccc;
6
+ padding: 10px;
7
+ line-height: 1.5em;
8
+
9
+ .fs-message
10
+ {
11
+ display: block;
12
+ margin-bottom: 5px;
13
+ font-size: 1.05em;
14
+ font-weight: 600;
15
+ }
16
+
17
+ &.error
18
+ {
19
+ border: 1px solid $fs-logo-magenta-color;
20
+ background: #fee;
21
+
22
+ .fs-message
23
+ {
24
+ color: $fs-logo-magenta-color;
25
+ }
26
+ }
27
+
28
+ .fs-input-container
29
+ {
30
+ margin-top: 5px;
31
+
32
+ label
33
+ {
34
+ margin-top: 5px;
35
+ display: block;
36
+
37
+ input
38
+ {
39
+ float: left;
40
+ margin: 1px 0 0 0;
41
+ }
42
+
43
+ &:first-child
44
+ {
45
+ display: block;
46
+ margin-bottom: 2px;
47
+ }
48
+ }
49
+ }
50
+
51
+ .fs-input-label
52
+ {
53
+ display: block;
54
+ margin-left: 20px;
55
+
56
+ .underlined
57
+ {
58
+ text-decoration: underline;
59
+ }
60
+ }
61
+ }
62
+
63
+ .rtl
64
+ {
65
+ #fs_marketing_optin
66
+ {
67
+ .fs-input-container
68
+ {
69
+ label input
70
+ {
71
+ float: right;
72
+ }
73
+ }
74
+
75
+ .fs-input-label
76
+ {
77
+ margin-left: 0;
78
+ margin-right: 20px;
79
+ }
80
+ }
81
  }
includes/pum-sdk/freemius/assets/scss/admin/_license-activation.scss CHANGED
@@ -1,47 +1,47 @@
1
- .fs-modal.fs-modal-license-activation {
2
- .fs-modal-body {
3
- input.license_key {
4
- width: 100%;
5
- }
6
- }
7
- }
8
-
9
- #license_options_container {
10
- table {
11
- &, select, #available_license_key {
12
- width: 100%;
13
- }
14
-
15
- td:first-child {
16
- width: 1%;
17
- }
18
-
19
- #other_license_key_container {
20
- label {
21
- position: relative;
22
- top: 6px;
23
- float: left;
24
- margin-right: 5px;
25
- }
26
-
27
- div {
28
- overflow: hidden;
29
- width: auto;
30
- height: 30px;
31
- display: block;
32
- top: 2px;
33
- position: relative;
34
-
35
- input {
36
- margin: 0;
37
- }
38
- }
39
- }
40
- }
41
- }
42
-
43
- #sites_list_container {
44
- td {
45
- cursor: pointer;
46
- }
47
  }
1
+ .fs-modal.fs-modal-license-activation {
2
+ .fs-modal-body {
3
+ input.license_key {
4
+ width: 100%;
5
+ }
6
+ }
7
+ }
8
+
9
+ #license_options_container {
10
+ table {
11
+ &, select, #available_license_key {
12
+ width: 100%;
13
+ }
14
+
15
+ td:first-child {
16
+ width: 1%;
17
+ }
18
+
19
+ #other_license_key_container {
20
+ label {
21
+ position: relative;
22
+ top: 6px;
23
+ float: left;
24
+ margin-right: 5px;
25
+ }
26
+
27
+ div {
28
+ overflow: hidden;
29
+ width: auto;
30
+ height: 30px;
31
+ display: block;
32
+ top: 2px;
33
+ position: relative;
34
+
35
+ input {
36
+ margin: 0;
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ #sites_list_container {
44
+ td {
45
+ cursor: pointer;
46
+ }
47
  }
includes/pum-sdk/freemius/assets/scss/admin/_license-key-resend.scss CHANGED
@@ -1,68 +1,68 @@
1
- .fs-modal.fs-modal-license-key-resend
2
- {
3
- .email-address-container
4
- {
5
- overflow: hidden;
6
- padding-right: 2px;
7
- }
8
-
9
- &.fs-freemium
10
- {
11
- input.email-address
12
- {
13
- width: 300px;
14
- }
15
-
16
- label
17
- {
18
- display: block;
19
- margin-bottom: 10px;
20
- }
21
- }
22
-
23
- &.fs-premium
24
- {
25
- input.email-address
26
- {
27
- width: 100%;
28
- }
29
-
30
- .button-container
31
- {
32
- float: right;
33
- margin-left: 7px;
34
-
35
- @media (max-width: 650px) {
36
- margin-top: 2px;
37
- }
38
- }
39
- }
40
- }
41
-
42
- .rtl
43
- {
44
- .fs-modal.fs-modal-license-key-resend
45
- {
46
- .fs-modal-body
47
- {
48
- .input-container > .email-address-container
49
- {
50
- padding-left: 2px;
51
- padding-right: 0;
52
- }
53
-
54
- .button-container
55
- {
56
- float: left;
57
- margin-right: 7px;
58
- margin-left: 0;
59
- }
60
- }
61
- }
62
- }
63
-
64
- a.show-license-resend-modal
65
- {
66
- margin-top: 4px;
67
- display: inline-block;
68
- }
1
+ .fs-modal.fs-modal-license-key-resend
2
+ {
3
+ .email-address-container
4
+ {
5
+ overflow: hidden;
6
+ padding-right: 2px;
7
+ }
8
+
9
+ &.fs-freemium
10
+ {
11
+ input.email-address
12
+ {
13
+ width: 300px;
14
+ }
15
+
16
+ label
17
+ {
18
+ display: block;
19
+ margin-bottom: 10px;
20
+ }
21
+ }
22
+
23
+ &.fs-premium
24
+ {
25
+ input.email-address
26
+ {
27
+ width: 100%;
28
+ }
29
+
30
+ .button-container
31
+ {
32
+ float: right;
33
+ margin-left: 7px;
34
+
35
+ @media (max-width: 650px) {
36
+ margin-top: 2px;
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ .rtl
43
+ {
44
+ .fs-modal.fs-modal-license-key-resend
45
+ {
46
+ .fs-modal-body
47
+ {
48
+ .input-container > .email-address-container
49
+ {
50
+ padding-left: 2px;
51
+ padding-right: 0;
52
+ }
53
+
54
+ .button-container
55
+ {
56
+ float: left;
57
+ margin-right: 7px;
58
+ margin-left: 0;
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ a.show-license-resend-modal
65
+ {
66
+ margin-top: 4px;
67
+ display: inline-block;
68
+ }
includes/pum-sdk/freemius/assets/scss/admin/_modal-common.scss CHANGED
@@ -1,194 +1,194 @@
1
- @import "../colors";
2
- @import "../mixins";
3
-
4
- .fs-modal {
5
- position: fixed;
6
- overflow: auto;
7
- height: 100%;
8
- width: 100%;
9
- top: 0;
10
- z-index: 100000;
11
- display: none;
12
- background: rgba(0, 0, 0, 0.6);
13
-
14
- .fs-modal-dialog {
15
- background: transparent;
16
- position: absolute;
17
- left: 50%;
18
- margin-left: -298px;
19
- padding-bottom: 30px;
20
- top: -100%;
21
- z-index: 100001;
22
- width: 596px;
23
-
24
- @media (max-width: 650px) {
25
- margin-left: -50%;
26
- box-sizing: border-box;
27
- padding-left: 10px;
28
- padding-right: 10px;
29
- width: 100%;
30
-
31
- .fs-modal-panel > h3 > strong {
32
- font-size: 1.3em;
33
- }
34
- }
35
- }
36
-
37
- &.active {
38
- display: block;
39
-
40
- &:before {
41
- display: block;
42
- }
43
-
44
- .fs-modal-dialog {
45
- top: 10%;
46
- }
47
- }
48
-
49
- &.fs-success {
50
- .fs-modal-header {
51
- border-bottom-color: $wp-notice-success-dark-color;
52
- }
53
-
54
- .fs-modal-body {
55
- background-color: $wp-notice-success-color;
56
- }
57
- }
58
-
59
- &.fs-warn {
60
- .fs-modal-header {
61
- border-bottom-color: $wp-notice-warn-dark-color;
62
- }
63
-
64
- .fs-modal-body {
65
- background-color: $wp-notice-warn-color;
66
- }
67
- }
68
-
69
- &.fs-error {
70
- .fs-modal-header {
71
- border-bottom-color: $wp-notice-error-dark-color;
72
- }
73
-
74
- .fs-modal-body {
75
- background-color: $wp-notice-error-color;
76
- }
77
- }
78
-
79
-
80
- .fs-modal-body,
81
- .fs-modal-footer {
82
- border: 0;
83
- background: #fefefe;
84
- padding: 20px;
85
- }
86
-
87
- .fs-modal-header {
88
- border-bottom: #eeeeee solid 1px;
89
- background: #fbfbfb;
90
- padding: 15px 20px;
91
- position: relative;
92
- margin-bottom: -10px;
93
- // z-index: 2;
94
-
95
- h4 {
96
- margin: 0;
97
- padding: 0;
98
- text-transform: uppercase;
99
- font-size: 1.2em;
100
- font-weight: bold;
101
- color: #cacaca;
102
- text-shadow: 1px 1px 1px #fff;
103
- letter-spacing: 0.6px;
104
- -webkit-font-smoothing: antialiased;
105
- }
106
-
107
- .fs-close {
108
- position: absolute;
109
- right: 10px;
110
- top: 12px;
111
- cursor: pointer;
112
- color: #bbb;
113
- @include border-radius(20px);
114
- padding: 3px;
115
- @include transition(all 0.2s ease-in-out);
116
-
117
- &:hover {
118
- color: #fff;
119
- background: #aaa;
120
- }
121
-
122
- &, &:hover
123
- {
124
- .dashicons
125
- {
126
- text-decoration: none;
127
- }
128
- }
129
- }
130
- }
131
-
132
- .fs-modal-body {
133
- border-bottom: 0;
134
-
135
- p {
136
- font-size: 14px;
137
- }
138
-
139
- h2 {
140
- font-size: 20px;
141
- line-height: 1.5em;
142
- }
143
-
144
- > div {
145
- margin-top: 10px;
146
-
147
- h2 {
148
- font-weight: bold;
149
- font-size: 20px;
150
- margin-top: 0;
151
- }
152
- }
153
- }
154
-
155
- .fs-modal-footer {
156
- border-top: #eeeeee solid 1px;
157
- text-align: right;
158
-
159
- > .button {
160
- margin: 0 7px;
161
-
162
- &:first-child {
163
- margin: 0;
164
- }
165
- }
166
- }
167
-
168
- .fs-modal-panel {
169
- > .notice.inline {
170
- margin: 0;
171
- display: none;
172
- }
173
-
174
- &:not(.active) {
175
- display: none;
176
- }
177
- }
178
- }
179
-
180
- .rtl
181
- {
182
- .fs-modal {
183
- .fs-modal-header {
184
- .fs-close {
185
- right: auto;
186
- left: 20px;
187
- }
188
- }
189
- }
190
- }
191
-
192
- body.has-fs-modal {
193
- overflow: hidden;
194
  }
1
+ @import "../colors";
2
+ @import "../mixins";
3
+
4
+ .fs-modal {
5
+ position: fixed;
6
+ overflow: auto;
7
+ height: 100%;
8
+ width: 100%;
9
+ top: 0;
10
+ z-index: 100000;
11
+ display: none;
12
+ background: rgba(0, 0, 0, 0.6);
13
+
14
+ .fs-modal-dialog {
15
+ background: transparent;
16
+ position: absolute;
17
+ left: 50%;
18
+ margin-left: -298px;
19
+ padding-bottom: 30px;
20
+ top: -100%;
21
+ z-index: 100001;
22
+ width: 596px;
23
+
24
+ @media (max-width: 650px) {
25
+ margin-left: -50%;
26
+ box-sizing: border-box;
27
+ padding-left: 10px;
28
+ padding-right: 10px;
29
+ width: 100%;
30
+
31
+ .fs-modal-panel > h3 > strong {
32
+ font-size: 1.3em;
33
+ }
34
+ }
35
+ }
36
+
37
+ &.active {
38
+ display: block;
39
+
40
+ &:before {
41
+ display: block;
42
+ }
43
+
44
+ .fs-modal-dialog {
45
+ top: 10%;
46
+ }
47
+ }
48
+
49
+ &.fs-success {
50
+ .fs-modal-header {
51
+ border-bottom-color: $wp-notice-success-dark-color;
52
+ }
53
+
54
+ .fs-modal-body {
55
+ background-color: $wp-notice-success-color;
56
+ }
57
+ }
58
+
59
+ &.fs-warn {
60
+ .fs-modal-header {
61
+ border-bottom-color: $wp-notice-warn-dark-color;
62
+ }
63
+
64
+ .fs-modal-body {
65
+ background-color: $wp-notice-warn-color;
66
+ }
67
+ }
68
+
69
+ &.fs-error {
70
+ .fs-modal-header {
71
+ border-bottom-color: $wp-notice-error-dark-color;
72
+ }
73
+
74
+ .fs-modal-body {
75
+ background-color: $wp-notice-error-color;
76
+ }
77
+ }
78
+
79
+
80
+ .fs-modal-body,
81
+ .fs-modal-footer {
82
+ border: 0;
83
+ background: #fefefe;
84
+ padding: 20px;
85
+ }
86
+
87
+ .fs-modal-header {
88
+ border-bottom: #eeeeee solid 1px;
89
+ background: #fbfbfb;
90
+ padding: 15px 20px;
91
+ position: relative;
92
+ margin-bottom: -10px;
93
+ // z-index: 2;
94
+
95
+ h4 {
96
+ margin: 0;
97
+ padding: 0;
98
+ text-transform: uppercase;
99
+ font-size: 1.2em;
100
+ font-weight: bold;
101
+ color: #cacaca;
102
+ text-shadow: 1px 1px 1px #fff;
103
+ letter-spacing: 0.6px;
104
+ -webkit-font-smoothing: antialiased;
105
+ }
106
+
107
+ .fs-close {
108
+ position: absolute;
109
+ right: 10px;
110
+ top: 12px;
111
+ cursor: pointer;
112
+ color: #bbb;
113
+ @include border-radius(20px);
114
+ padding: 3px;
115
+ @include transition(all 0.2s ease-in-out);
116
+
117
+ &:hover {
118
+ color: #fff;
119
+ background: #aaa;
120
+ }
121
+
122
+ &, &:hover
123
+ {
124
+ .dashicons
125
+ {
126
+ text-decoration: none;
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ .fs-modal-body {
133
+ border-bottom: 0;
134
+
135
+ p {
136
+ font-size: 14px;
137
+ }
138
+
139
+ h2 {
140
+ font-size: 20px;
141
+ line-height: 1.5em;
142
+ }
143
+
144
+ > div {
145
+ margin-top: 10px;
146
+
147
+ h2 {
148
+ font-weight: bold;
149
+ font-size: 20px;
150
+ margin-top: 0;
151
+ }
152
+ }
153
+ }
154
+
155
+ .fs-modal-footer {
156
+ border-top: #eeeeee solid 1px;
157
+ text-align: right;
158
+
159
+ > .button {
160
+ margin: 0 7px;
161
+
162
+ &:first-child {
163
+ margin: 0;
164
+ }
165
+ }
166
+ }
167
+
168
+ .fs-modal-panel {
169
+ > .notice.inline {
170
+ margin: 0;
171
+ display: none;
172
+ }
173
+
174
+ &:not(.active) {
175
+ display: none;
176
+ }
177
+ }
178
+ }
179
+
180
+ .rtl
181
+ {
182
+ .fs-modal {
183
+ .fs-modal-header {
184
+ .fs-close {
185
+ right: auto;
186
+ left: 20px;
187
+ }
188
+ }
189
+ }
190
+ }
191
+
192
+ body.has-fs-modal {
193
+ overflow: hidden;
194
  }
includes/pum-sdk/freemius/assets/scss/admin/_multisite-options.scss CHANGED
@@ -1,40 +1,40 @@
1
- #multisite_options_container {
2
- margin-top: 10px;
3
- border: 1px solid #ccc;
4
- padding: 5px;
5
-
6
- a {
7
- text-decoration: none;
8
-
9
- &:focus {
10
- box-shadow: none;
11
- }
12
-
13
- &.selected {
14
- font-weight: bold;
15
- }
16
- }
17
-
18
- &.apply-on-all-sites {
19
- border: 0 none;
20
- padding: 0;
21
-
22
- #all_sites_options {
23
- border-spacing: 0;
24
-
25
- td:not(:first-child) {
26
- display: none;
27
- }
28
- }
29
- }
30
-
31
- #sites_list_container {
32
- display: none;
33
- overflow: auto;
34
-
35
- table td {
36
- border-top: 1px solid #ccc;
37
- padding: 4px 2px;
38
- }
39
- }
40
  }
1
+ #multisite_options_container {
2
+ margin-top: 10px;
3
+ border: 1px solid #ccc;
4
+ padding: 5px;
5
+
6
+ a {
7
+ text-decoration: none;
8
+
9
+ &:focus {
10
+ box-shadow: none;
11
+ }
12
+
13
+ &.selected {
14
+ font-weight: bold;
15
+ }
16
+ }
17
+
18
+ &.apply-on-all-sites {
19
+ border: 0 none;
20
+ padding: 0;
21
+
22
+ #all_sites_options {
23
+ border-spacing: 0;
24
+
25
+ td:not(:first-child) {
26
+ display: none;
27
+ }
28
+ }
29
+ }
30
+
31
+ #sites_list_container {
32
+ display: none;
33
+ overflow: auto;
34
+
35
+ table td {
36
+ border-top: 1px solid #ccc;
37
+ padding: 4px 2px;
38
+ }
39
+ }
40
  }
includes/pum-sdk/freemius/assets/scss/admin/_plugin-upgrade-notice.scss ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ .plugins p.fs-upgrade-notice
2
+ {
3
+ border: 0;
4
+ background-color: #d54e21;
5
+ padding: 10px;
6
+ color: #f9f9f9;
7
+ margin-top: 10px;
8
+ }
includes/pum-sdk/freemius/assets/scss/admin/_subscription-cancellation.scss ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .fs-modal.fs-modal-subscription-cancellation {
2
+ .fs-price-increase-warning {
3
+ color: red;
4
+ font-weight: bold;
5
+ padding: 0 25px;
6
+ margin-bottom: 0;
7
+ }
8
+
9
+ ul.subscription-actions label {
10
+ input {
11
+ float: left;
12
+ top: 5px;
13
+ position: relative;
14
+
15
+ .rtl & {
16
+ float: right;
17
+ }
18
+ }
19
+
20
+ span {
21
+ display: block;
22
+ margin-left: 24px;
23
+
24
+ .rtl & {
25
+ margin-left: 0;
26
+ margin-right: 24px;
27
+ }
28
+ }
29
+ }
30
+ }
includes/pum-sdk/freemius/assets/scss/admin/_themes.scss CHANGED
@@ -1,21 +1,21 @@
1
- .theme-browser
2
- {
3
- .theme
4
- {
5
- .fs-premium-theme-badge
6
- {
7
- position: absolute;
8
- top: 10px;
9
- right: 0;
10
- background: $fs-logo-green-color;
11
- color: #fff;
12
- text-transform: uppercase;
13
- padding: 5px 10px;
14
- @include border-radius(3px 0 0 3px);
15
- font-weight: bold;
16
- border-right: 0;
17
- @include box-shadow(0 2px 1px -1px rgba(0, 0, 0, .3));
18
- font-size: 1.1em;
19
- }
20
- }
21
  }
1
+ .theme-browser
2
+ {
3
+ .theme
4
+ {
5
+ .fs-premium-theme-badge
6
+ {
7
+ position: absolute;
8
+ top: 10px;
9
+ right: 0;
10
+ background: $fs-logo-green-color;
11
+ color: #fff;
12
+ text-transform: uppercase;
13
+ padding: 5px 10px;
14
+ @include border-radius(3px 0 0 3px);
15
+ font-weight: bold;
16
+ border-right: 0;
17
+ @include box-shadow(0 2px 1px -1px rgba(0, 0, 0, .3));
18
+ font-size: 1.1em;
19
+ }
20
+ }
21
  }
includes/pum-sdk/freemius/assets/scss/admin/_tooltip.scss CHANGED
@@ -1,66 +1,66 @@
1
- .fs-tooltip-trigger
2
- {
3
- &:not(a)
4
- {
5
- cursor: help;
6
- }
7
-
8
- position: relative;
9
-
10
- .fs-tooltip
11
- {
12
- opacity: 0;
13
- visibility: hidden;
14
- @include transition(opacity 0.3s ease-in-out);
15
- position: absolute;
16
- background: $tooltip-bkg-color;
17
- color: $tooltip-color;
18
- font-family: 'arial', serif;
19
- font-size: 12px;
20
- padding: 10px;
21
- z-index: 999999;
22
- bottom: 100%;
23
- margin-bottom: 5px;
24
- left: 0;
25
- right: 0;
26
- @include border-radius(5px);
27
- @include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
28
- line-height: 1.3em;
29
- font-weight: bold;
30
- text-align: left;
31
-
32
- .rtl &
33
- {
34
- text-align: right;
35
- }
36
-
37
- &::after
38
- {
39
- content: ' ';
40
- display: block;
41
- width: 0;
42
- height: 0;
43
- border-style: solid;
44
- border-width: 5px 5px 0 5px;
45
- border-color: $tooltip-bkg-color transparent transparent transparent;
46
- position: absolute;
47
- top: 100%;
48
- left: 21px;
49
-
50
- .rtl &
51
- {
52
- right: 21px;
53
- left: auto;
54
- }
55
- }
56
- }
57
-
58
- &:hover
59
- {
60
- .fs-tooltip
61
- {
62
- visibility: visible;
63
- opacity: 1;
64
- }
65
- }
66
  }
1
+ .fs-tooltip-trigger
2
+ {
3
+ &:not(a)
4
+ {
5
+ cursor: help;
6
+ }
7
+
8
+ position: relative;
9
+
10
+ .fs-tooltip
11
+ {
12
+ opacity: 0;
13
+ visibility: hidden;
14
+ @include transition(opacity 0.3s ease-in-out);
15
+ position: absolute;
16
+ background: $tooltip-bkg-color;
17
+ color: $tooltip-color;
18
+ font-family: 'arial', serif;
19
+ font-size: 12px;
20
+ padding: 10px;
21
+ z-index: 999999;
22
+ bottom: 100%;
23
+ margin-bottom: 5px;
24
+ left: 0;
25
+ right: 0;
26
+ @include border-radius(5px);
27
+ @include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
28
+ line-height: 1.3em;
29
+ font-weight: bold;
30
+ text-align: left;
31
+
32
+ .rtl &
33
+ {
34
+ text-align: right;
35
+ }
36
+
37
+ &::after
38
+ {
39
+ content: ' ';
40
+ display: block;
41
+ width: 0;
42
+ height: 0;
43
+ border-style: solid;
44
+ border-width: 5px 5px 0 5px;
45
+ border-color: $tooltip-bkg-color transparent transparent transparent;
46
+ position: absolute;
47
+ top: 100%;
48
+ left: 21px;
49
+
50
+ .rtl &
51
+ {
52
+ right: 21px;
53
+ left: auto;
54
+ }
55
+ }
56
+ }
57
+
58
+ &:hover
59
+ {
60
+ .fs-tooltip
61
+ {
62
+ visibility: visible;
63
+ opacity: 1;
64
+ }
65
+ }
66
  }
includes/pum-sdk/freemius/assets/scss/admin/account.scss CHANGED
@@ -1,302 +1,302 @@
1
- @import "../start";
2
-
3
- #fs_account
4
- {
5
- .postbox,
6
- .widefat
7
- {
8
- max-width: 700px;
9
- }
10
-
11
- h3
12
- {
13
- font-size: 1.3em;
14
- padding: 12px 15px;
15
- margin: 0 0 12px 0;
16
- line-height: 1.4;
17
- border-bottom: 1px solid #F1F1F1;
18
-
19
- .dashicons {
20
- width: 26px;
21
- height: 26px;
22
- font-size: 1.3em;
23
- }
24
- }
25
-
26
- i.dashicons
27
- {
28
- font-size: 1.2em;
29
- height: 1.2em;
30
- width: 1.2em;
31
- }
32
-
33
- .dashicons
34
- {
35
- vertical-align: middle;
36
- }
37
-
38
- .fs-header-actions
39
- {
40
- position: absolute;
41
- top: 17px;
42
- right: 15px;
43
- font-size: 0.9em;
44
-
45
- ul
46
- {
47
- margin: 0;
48
- }
49
-
50
- li
51
- {
52
- form
53
- {
54
- display: inline-block;
55
- }
56
-
57
- float: left;
58
- a
59
- {
60
- text-decoration: none;
61
- }
62
- }
63
- }
64
- }
65
-
66
- #fs_account_details .button-group {
67
- float: right;
68
- }
69
-
70
- .rtl #fs_account .fs-header-actions
71
- {
72
- left: 15px;
73
- right: auto;
74
- }
75
-
76
- .fs-key-value-table
77
- {
78
- width: 100%;
79
-
80
- form
81
- {
82
- display: inline-block;
83
- }
84
-
85
- tr
86
- {
87
- td:first-child
88
- {
89
- nobr
90
- {
91
- font-weight: bold;
92
- }
93
-
94
- text-align: right;
95
-
96
- form
97
- {
98
- display: block;
99
- }
100
- }
101
-
102
- td.fs-right
103
- {
104
- text-align: right;
105
- }
106
-
107
- &.fs-odd
108
- {
109
- background: #ebebeb;
110
- }
111
- }
112
-
113
- td, th
114
- {
115
- padding: 10px;
116
- }
117
-
118
- code {
119
- line-height: 28px;
120
- }
121
-
122
- var, code, input[type="text"]
123
- {
124
- color: #0073AA;
125
- font-size: 16px;
126
- background: none;
127
- }
128
-
129
- input[type="text"] {
130
- width: 100%;
131
- font-weight: bold;
132
- }
133
- }
134
-
135
- label.fs-tag
136
- {
137
- background: #ffba00;
138
- color: #fff;
139
- display: inline-block;
140
- border-radius: 3px;
141
- padding: 5px;
142
- font-size: 11px;
143
- line-height: 11px;
144
- vertical-align: baseline;
145
-
146
- &.fs-warn
147
- {
148
- background: #ffba00;
149
- }
150
- &.fs-success
151
- {
152
- background: #46b450;
153
- }
154
- &.fs-error
155
- {
156
- background: #dc3232;
157
- }
158
- }
159
-
160
- #fs_sites
161
- {
162
- .fs-scrollable-table
163
- {
164
- .fs-table-body {
165
- max-height: 200px;
166
- overflow: auto;
167
- border: 1px solid #e5e5e5;
168
-
169
- & > table.widefat {
170
- border: none !important;
171
- }
172
- }
173
-
174
- .fs-main-column {
175
- width: 100%;
176
- }
177
-
178
- .fs-site-details
179
- {
180
- td:first-of-type
181
- {
182
- text-align: right;
183
- color: grey;
184
- width: 1px;
185
- }
186
-
187
- td:last-of-type
188
- {
189
- text-align: right;
190
- }
191
- }
192
-
193
- .fs-install-details table
194
- {
195
- tr td
196
- {
197
- width: 1px;
198
- white-space: nowrap;
199
-
200
- &:last-of-type
201
- {
202
- width: auto;
203
- }
204
- }
205
- }
206
- }
207
- }
208
-
209
- #fs_addons
210
- {
211
- h3
212
- {
213
- border: none;
214
- margin-bottom: 0;
215
- padding: 4px 5px;
216
- }
217
-
218
- td
219
- {
220
- vertical-align: middle;
221
- }
222
-
223
- thead {
224
- white-space: nowrap;
225
- }
226
-
227
- td:first-child,
228
- th:first-child
229
- {
230
- text-align: left;
231
- font-weight: bold;
232
- }
233
- td:last-child,
234
- th:last-child
235
- {
236
- text-align: right;
237
- }
238
- th
239
- {
240
- font-weight: bold;
241
- }
242
- }
243
-
244
- #fs_billing_address {
245
- width: 100%;
246
-
247
- tr {
248
- td {
249
- width: 50%;
250
- padding: 5px;
251
- }
252
-
253
- &:first-of-type {
254
- td {
255
- padding-top: 0;
256
- }
257
- }
258
- }
259
-
260
- @mixin read-mode {
261
- border-color: transparent;
262
- color: #777;
263
- border-bottom: 1px dashed #ccc;
264
- padding-left: 0;
265
- background: none;
266
- }
267
-
268
- span {
269
- font-weight: bold;
270
- }
271
-
272
- input, select {
273
- @include placeholder(transparent);
274
-
275
- display: block;
276
- width: 100%;
277
- margin-top: 5px;
278
-
279
- &.fs-read-mode {
280
- @include read-mode();
281
- }
282
- }
283
-
284
-
285
- &.fs-read-mode {
286
- td span {
287
- display: none;
288
- }
289
-
290
- input, select
291
- {
292
- @include read-mode();
293
- @include placeholder(#ccc);
294
- }
295
- }
296
-
297
-
298
- button {
299
- display: block;
300
- width: 100%;
301
- }
302
  }
1
+ @import "../start";
2
+
3
+ #fs_account
4
+ {
5
+ .postbox,
6
+ .widefat
7
+ {
8
+ max-width: 700px;
9
+ }
10
+
11
+ h3
12
+ {
13
+ font-size: 1.3em;
14
+ padding: 12px 15px;
15
+ margin: 0 0 12px 0;
16
+ line-height: 1.4;
17
+ border-bottom: 1px solid #F1F1F1;
18
+
19
+ .dashicons {
20
+ width: 26px;
21
+ height: 26px;
22
+ font-size: 1.3em;
23
+ }
24
+ }
25
+
26
+ i.dashicons
27
+ {
28
+ font-size: 1.2em;
29
+ height: 1.2em;
30
+ width: 1.2em;
31
+ }
32
+
33
+ .dashicons
34
+ {
35
+ vertical-align: middle;
36
+ }
37
+
38
+ .fs-header-actions
39
+ {
40
+ position: absolute;
41
+ top: 17px;
42
+ right: 15px;
43
+ font-size: 0.9em;
44
+
45
+ ul
46
+ {
47
+ margin: 0;
48
+ }
49
+
50
+ li
51
+ {
52
+ form
53
+ {
54
+ display: inline-block;
55
+ }
56
+
57
+ float: left;
58
+ a
59
+ {
60
+ text-decoration: none;
61
+ }
62
+ }
63
+ }
64
+ }
65
+
66
+ #fs_account_details .button-group {
67
+ float: right;
68
+ }
69
+
70
+ .rtl #fs_account .fs-header-actions
71
+ {
72
+ left: 15px;
73
+ right: auto;
74
+ }
75
+
76
+ .fs-key-value-table
77
+ {
78
+ width: 100%;
79
+
80
+ form
81
+ {
82
+ display: inline-block;
83
+ }
84
+
85
+ tr
86
+ {
87
+ td:first-child
88
+ {
89
+ nobr
90
+ {
91
+ font-weight: bold;
92
+ }
93
+
94
+ text-align: right;
95
+
96
+ form
97
+ {
98
+ display: block;
99
+ }
100
+ }
101
+
102
+ td.fs-right
103
+ {
104
+ text-align: right;
105
+ }
106
+
107
+ &.fs-odd
108
+ {
109
+ background: #ebebeb;
110
+ }
111
+ }
112
+
113
+ td, th
114
+ {
115
+ padding: 10px;
116
+ }
117
+
118
+ code {
119
+ line-height: 28px;
120
+ }
121
+
122
+ var, code, input[type="text"]
123
+ {
124
+ color: #0073AA;
125
+ font-size: 16px;
126
+ background: none;
127
+ }
128
+
129
+ input[type="text"] {
130
+ width: 100%;
131
+ font-weight: bold;
132
+ }
133
+ }
134
+
135
+ label.fs-tag
136
+ {
137
+ background: #ffba00;
138
+ color: #fff;
139
+ display: inline-block;
140
+ border-radius: 3px;
141
+ padding: 5px;
142
+ font-size: 11px;
143
+ line-height: 11px;
144
+ vertical-align: baseline;
145
+
146
+ &.fs-warn
147
+ {
148
+ background: #ffba00;
149
+ }
150
+ &.fs-success
151
+ {
152
+ background: #46b450;
153
+ }
154
+ &.fs-error
155
+ {
156
+ background: #dc3232;
157
+ }
158
+ }
159
+
160
+ #fs_sites
161
+ {
162
+ .fs-scrollable-table
163
+ {
164
+ .fs-table-body {
165
+ max-height: 200px;
166
+ overflow: auto;
167
+ border: 1px solid #e5e5e5;
168
+
169
+ & > table.widefat {
170
+ border: none !important;
171
+ }
172
+ }
173
+
174
+ .fs-main-column {
175
+ width: 100%;
176
+ }
177
+
178
+ .fs-site-details
179
+ {
180
+ td:first-of-type
181
+ {
182
+ text-align: right;
183
+ color: grey;
184
+ width: 1px;
185
+ }
186
+
187
+ td:last-of-type
188
+ {
189
+ text-align: right;
190
+ }
191
+ }
192
+
193
+ .fs-install-details table
194
+ {
195
+ tr td
196
+ {
197
+ width: 1px;
198
+ white-space: nowrap;
199
+
200
+ &:last-of-type
201
+ {
202
+ width: auto;
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+
209
+ #fs_addons
210
+ {
211
+ h3
212
+ {
213
+ border: none;
214
+ margin-bottom: 0;
215
+ padding: 4px 5px;
216
+ }
217
+
218
+ td
219
+ {
220
+ vertical-align: middle;
221
+ }
222
+
223
+ thead {
224
+ white-space: nowrap;
225
+ }
226
+
227
+ td:first-child,
228
+ th:first-child
229
+ {
230
+ text-align: left;
231
+ font-weight: bold;
232
+ }
233
+ td:last-child,
234
+ th:last-child
235
+ {
236
+ text-align: right;
237
+ }
238
+ th
239
+ {
240
+ font-weight: bold;
241
+ }
242
+ }
243
+
244
+ #fs_billing_address {
245
+ width: 100%;
246
+
247
+ tr {
248
+ td {
249
+ width: 50%;
250
+ padding: 5px;
251
+ }
252
+
253
+ &:first-of-type {
254
+ td {
255
+ padding-top: 0;
256
+ }
257
+ }
258
+ }
259
+
260
+ @mixin read-mode {
261
+ border-color: transparent;
262
+ color: #777;
263
+ border-bottom: 1px dashed #ccc;
264
+ padding-left: 0;
265
+ background: none;
266
+ }
267
+
268
+ span {
269
+ font-weight: bold;
270
+ }
271
+
272
+ input, select {
273
+ @include placeholder(transparent);
274
+
275
+ display: block;
276
+ width: 100%;
277
+ margin-top: 5px;
278
+
279
+ &.fs-read-mode {
280
+ @include read-mode();
281
+ }
282
+ }
283
+
284
+
285
+ &.fs-read-mode {
286
+ td span {
287
+ display: none;
288
+ }
289
+
290
+ input, select
291
+ {
292
+ @include read-mode();
293
+ @include placeholder(#ccc);
294
+ }
295
+ }
296
+
297
+
298
+ button {
299
+ display: block;
300
+ width: 100%;
301
+ }
302
  }
includes/pum-sdk/freemius/assets/scss/admin/add-ons.scss CHANGED
@@ -1,449 +1,449 @@
1
- @import "../start";
2
-
3
- #fs_addons
4
- {
5
- .fs-cards-list
6
- {
7
- list-style: none;
8
-
9
- .fs-card
10
- {
11
- float: left;
12
- // height: 185px; // With reviews/ratings
13
- height: 152px;
14
- width: 310px;
15
- padding: 0;
16
- margin: 0 0 30px 30px;
17
- font-size: 14px;
18
- list-style: none;
19
- border: 1px solid #ddd;
20
- cursor: pointer;
21
- position: relative;
22
-
23
- .fs-overlay
24
- {
25
- position: absolute;
26
- left: 0;
27
- right: 0;
28
- bottom: 0;
29
- top: 0;
30
- z-index: 9;
31
- }
32
-
33
- .fs-inner
34
- {
35
- background-color: #fff;
36
- overflow: hidden;
37
- height: 100%;
38
- position: relative;
39
-
40
- ul
41
- {
42
- @include transition(all, 0.15s);
43
- left: 0;
44
- right: 0;
45
- top: 0;
46
- position: absolute;
47
- }
48
-
49
- li
50
- {
51
- list-style: none;
52
- line-height: 18px;
53
- padding: 0 15px;
54
- width: 100%;
55
- display: block;
56
- @include box-sizing(border-box);
57
- }
58
-
59
- .fs-card-banner
60
- {
61
- padding: 0;
62
- margin: 0;
63
- line-height: 0;
64
- display: block;
65
- height: 100px;
66
- background-repeat: repeat-x;
67
- background-size: 100% 100%;
68
- @include transition(all, 0.15s);
69
- }
70
-
71
- .fs-title
72
- {
73
- margin: 10px 0 0 0;
74
- height: 18px;
75
- overflow: hidden;
76
- color: #000;
77
- white-space: nowrap;
78
- text-overflow: ellipsis;
79
- font-weight: bold;
80
- }
81
-
82
- .fs-offer
83
- {
84
- font-size: 0.9em;
85
- }
86
-
87
- .fs-description
88
- {
89
- background-color: #f9f9f9;
90
- padding: 10px 15px 100px 15px;
91
- border-top: 1px solid #eee;
92
- margin: 0 0 10px 0;
93
- color: #777;
94
- }
95
-
96
- .fs-tag
97
- {
98
- position: absolute;
99
- top: 10px;
100
- right: 0px;
101
- background: greenyellow;
102
- display: block;
103
- padding: 2px 10px;
104
- @include box-shadow(1px 1px 1px rgba(0,0,0,0.3));
105
- text-transform: uppercase;
106
- font-size: 0.9em;
107
- font-weight: bold;
108
- }
109
-
110
- .fs-cta
111
- {
112
- .button
113
- {
114
- position: absolute;
115
- top: 112px;
116
- right: 10px;
117
- }
118
- }
119
- }
120
-
121
- @media screen and (min-width: 960px) {
122
- &:hover
123
- {
124
- .fs-overlay
125
- {
126
- border: 2px solid $fms-link-color;
127
- margin-left: -1px;
128
- margin-top: -1px;
129
- }
130
-
131
- .fs-inner
132
- {
133
- ul
134
- {
135
- top: -100px;
136
- }
137
-
138
- .fs-card-banner
139
- {
140
- // background-position: 50% -100px;
141
- }
142
-
143
- .fs-title,
144
- .fs-offer
145
- {
146
- color: $fms-link-color;
147
- }
148
- }
149
- }
150
- }
151
- }
152
- }
153
- }
154
-
155
- #TB_window
156
- {
157
- &, iframe
158
- {
159
- width: 772px !important;
160
- }
161
- }
162
-
163
- #plugin-information
164
- {
165
- #section-description
166
- {
167
- h2, h3, p, b, i, blockquote, li, ul, ol
168
- {
169
- clear: none;
170
- }
171
-
172
- .fs-selling-points
173
- {
174
- padding-bottom: 10px;
175
- border-bottom: 1px solid #ddd;
176
-
177
- ul
178
- {
179
- margin: 0;
180
-
181
- li
182
- {
183
- padding: 0;
184
- list-style: none outside none;
185
-
186
- i.dashicons
187
- {
188
- color: $fs-logo-green-color;
189
- font-size: 3em;
190
- vertical-align: middle;
191
- line-height: 30px;
192
- float: left;
193
- margin: 0 0 0 -15px;
194
- }
195
-
196
- h3
197
- {
198
- margin: 1em 30px !important;
199
- }
200
- }
201
- }
202
- }
203
-
204
- .fs-screenshots
205
- {
206
- @include clearfix();
207
- ul
208
- {
209
- list-style: none;
210
- margin: 0;
211
-
212
- li
213
- {
214
- width: 225px;
215
- height: 225px;
216
- float: left;
217
- margin-bottom: 20px;
218
- @include box-sizing(content-box);
219
-
220
- a
221
- {
222
- display: block;
223
- width: 100%;
224
- height: 100%;
225
- border: 1px solid;
226
- @include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
227
- background-size: cover;
228
- }
229
-
230
- &.odd
231
- {
232
- margin-right: 20px;
233
- }
234
- }
235
- }
236
- }
237
- }
238
-
239
- .plugin-information-pricing
240
- {
241
- $pricing_color: #FFFEEC;
242
- $borders_color: #DDD;
243
- margin: -16px;
244
- // padding: 20px;
245
- border-bottom: 1px solid $borders_color;
246
-
247
- .fs-plan
248
- {
249
-
250
- h3
251
- {
252
- margin-top: 0;
253
- padding: 20px;
254
- font-size: 16px;
255
- }
256
-
257
- .nav-tab-wrapper
258
- {
259
- border-bottom: 1px solid $borders_color;
260
-
261
- .nav-tab
262
- {
263
- cursor: pointer;
264
- position: relative;
265
- padding: 0 10px;
266
- font-size: 0.9em;
267
-
268
- label
269
- {
270
- text-transform: uppercase;
271
- color: green;
272
- background: greenyellow;
273
- position: absolute;
274
- left: -1px;
275
- right: -1px;
276
- bottom: 100%;
277
- border: 1px solid darkgreen;
278
- padding: 2px;
279
- text-align: center;
280
- font-size: 0.9em;
281
- line-height: 1em;
282
- }
283
-
284
- &.nav-tab-active
285
- {
286
- cursor: default;
287
- background: $pricing_color;
288
- border-bottom-color: $pricing_color;
289
- }
290
- }
291
- }
292
-
293
- &.fs-single-cycle
294
- {
295
- h3
296
- {
297
- background: $pricing_color;
298
- margin: 0;
299
- padding-bottom: 0;
300
- color: #0073aa;
301
- }
302
-
303
- .nav-tab-wrapper,
304
- .fs-billing-frequency
305
- {
306
- display: none;
307
- }
308
- }
309
-
310
- .fs-pricing-body
311
- {
312
- background: $pricing_color;
313
- padding: 20px;
314
- }
315
-
316
- .button
317
- {
318
- width: 100%;
319
- text-align: center;
320
- font-weight: bold;
321
- text-transform: uppercase;
322
- font-size: 1.1em;
323
- }
324
-
325
- label
326
- {
327
- white-space: nowrap;
328
- }
329
-
330
- var {
331
- font-style: normal;
332
- }
333
-
334
- .fs-billing-frequency,
335
- .fs-annual-discount
336
- {
337
- text-align: center;
338
- display: block;
339
- font-weight: bold;
340
- margin-bottom: 10px;
341
- text-transform: uppercase;
342
- background: #F3F3F3;
343
- padding: 2px;
344
- border: 1px solid #ccc;
345
- }
346
-
347
- .fs-annual-discount
348
- {
349
- text-transform: none;
350
- color: green;
351
- background: greenyellow;
352
- }
353
-
354
- ul.fs-trial-terms
355
- {
356
- font-size: 0.9em;
357
-
358
- i
359
- {
360
- float: left;
361
- margin: 0 0 0 -15px;
362
- }
363
-
364
- li
365
- {
366
- margin: 10px 0 0 0;
367
- }
368
- }
369
- }
370
- }
371
-
372
- #section-features
373
- {
374
- .fs-features
375
- {
376
- margin: -20px -26px;
377
- }
378
-
379
- table
380
- {
381
- width: 100%;
382
- border-spacing: 0;
383
- border-collapse: separate;
384
-
385
- thead
386
- {
387
- th
388
- {
389
- padding: 10px 0;
390
- }
391
-
392
- .fs-price
393
- {
394
- color: $fs-logo-green-color;
395
- font-weight: normal;
396
- display: block;
397
- text-align: center;
398
- }
399
- }
400
-
401
- tbody
402
- {
403
- td
404
- {
405
- border-top: 1px solid #ccc;
406
- padding: 10px 0;
407
- text-align: center;
408
- width: 100px;
409
- color: $fs-logo-green-color;
410
-
411
- &:first-child
412
- {
413
- text-align: left;
414
- width: auto;
415
- color: inherit;
416
- padding-left: 26px;
417
- }
418
- }
419
- tr.fs-odd
420
- {
421
- td
422
- {
423
- background: #fefefe;
424
- }
425
- }
426
- }
427
- }
428
-
429
- .dashicons-yes
430
- {
431
- width: 30px;
432
- height: 30px;
433
- font-size: 30px;
434
- }
435
- }
436
- }
437
-
438
- @media screen and (max-width: 961px) {
439
- #fs_addons
440
- {
441
- .fs-cards-list
442
- {
443
- .fs-card
444
- {
445
- height: 265px;
446
- }
447
- }
448
- }
449
  }
1
+ @import "../start";
2
+
3
+ #fs_addons
4
+ {
5
+ .fs-cards-list
6
+ {
7
+ list-style: none;
8
+
9
+ .fs-card
10
+ {
11
+ float: left;
12
+ // height: 185px; // With reviews/ratings
13
+ height: 152px;
14
+ width: 310px;
15
+ padding: 0;
16
+ margin: 0 0 30px 30px;
17
+ font-size: 14px;
18
+ list-style: none;
19
+ border: 1px solid #ddd;
20
+ cursor: pointer;
21
+ position: relative;
22
+
23
+ .fs-overlay
24
+ {
25
+ position: absolute;
26
+ left: 0;
27
+ right: 0;
28
+ bottom: 0;
29
+ top: 0;
30
+ z-index: 9;
31
+ }
32
+
33
+ .fs-inner
34
+ {
35
+ background-color: #fff;
36
+ overflow: hidden;
37
+ height: 100%;
38
+ position: relative;
39
+
40
+ ul
41
+ {
42
+ @include transition(all, 0.15s);
43
+ left: 0;
44
+ right: 0;
45
+ top: 0;
46
+ position: absolute;
47
+ }
48
+
49
+ li
50
+ {
51
+ list-style: none;
52
+ line-height: 18px;
53
+ padding: 0 15px;
54
+ width: 100%;
55
+ display: block;
56
+ @include box-sizing(border-box);
57
+ }
58
+
59
+ .fs-card-banner
60
+ {
61
+ padding: 0;
62
+ margin: 0;
63
+ line-height: 0;
64
+ display: block;
65
+ height: 100px;
66
+ background-repeat: repeat-x;
67
+ background-size: 100% 100%;
68
+ @include transition(all, 0.15s);
69
+ }
70
+
71
+ .fs-title
72
+ {
73
+ margin: 10px 0 0 0;
74
+ height: 18px;
75
+ overflow: hidden;
76
+ color: #000;
77
+ white-space: nowrap;
78
+ text-overflow: ellipsis;
79
+ font-weight: bold;
80
+ }
81
+
82
+ .fs-offer
83
+ {
84
+ font-size: 0.9em;
85
+ }
86
+
87
+ .fs-description
88
+ {
89
+ background-color: #f9f9f9;
90
+ padding: 10px 15px 100px 15px;
91
+ border-top: 1px solid #eee;
92
+ margin: 0 0 10px 0;
93
+ color: #777;
94
+ }
95
+
96
+ .fs-tag
97
+ {
98
+ position: absolute;
99
+ top: 10px;
100
+ right: 0px;
101
+ background: greenyellow;
102
+ display: block;
103
+ padding: 2px 10px;
104
+ @include box-shadow(1px 1px 1px rgba(0,0,0,0.3));
105
+ text-transform: uppercase;
106
+ font-size: 0.9em;
107
+ font-weight: bold;
108
+ }
109
+
110
+ .fs-cta
111
+ {
112
+ .button
113
+ {
114
+ position: absolute;
115
+ top: 112px;
116
+ right: 10px;
117
+ }
118
+ }
119
+ }
120
+
121
+ @media screen and (min-width: 960px) {
122
+ &:hover
123
+ {
124
+ .fs-overlay
125
+ {
126
+ border: 2px solid $fms-link-color;
127
+ margin-left: -1px;
128
+ margin-top: -1px;
129
+ }
130
+
131
+ .fs-inner
132
+ {
133
+ ul
134
+ {
135
+ top: -100px;
136
+ }
137
+
138
+ .fs-card-banner
139
+ {
140
+ // background-position: 50% -100px;
141
+ }
142
+
143
+ .fs-title,
144
+ .fs-offer
145
+ {
146
+ color: $fms-link-color;
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+
155
+ #TB_window
156
+ {
157
+ &, iframe
158
+ {
159
+ width: 772px !important;
160
+ }
161
+ }
162
+
163
+ #plugin-information
164
+ {
165
+ #section-description
166
+ {
167
+ h2, h3, p, b, i, blockquote, li, ul, ol
168
+ {
169
+ clear: none;
170
+ }
171
+
172
+ .fs-selling-points
173
+ {
174
+ padding-bottom: 10px;
175
+ border-bottom: 1px solid #ddd;
176
+
177
+ ul
178
+ {
179
+ margin: 0;
180
+
181
+ li
182
+ {
183
+ padding: 0;
184
+ list-style: none outside none;
185
+
186
+ i.dashicons
187
+ {
188
+ color: $fs-logo-green-color;
189
+ font-size: 3em;
190
+ vertical-align: middle;
191
+ line-height: 30px;
192
+ float: left;
193
+ margin: 0 0 0 -15px;
194
+ }
195
+
196
+ h3
197
+ {
198
+ margin: 1em 30px !important;
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ .fs-screenshots
205
+ {
206
+ @include clearfix();
207
+ ul
208
+ {
209
+ list-style: none;
210
+ margin: 0;
211
+
212
+ li
213
+ {
214
+ width: 225px;
215
+ height: 225px;
216
+ float: left;
217
+ margin-bottom: 20px;
218
+ @include box-sizing(content-box);
219
+
220
+ a
221
+ {
222
+ display: block;
223
+ width: 100%;
224
+ height: 100%;
225
+ border: 1px solid;
226
+ @include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
227
+ background-size: cover;
228
+ }
229
+
230
+ &.odd
231
+ {
232
+ margin-right: 20px;
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+
239
+ .plugin-information-pricing
240
+ {
241
+ $pricing_color: #FFFEEC;
242
+ $borders_color: #DDD;
243
+ margin: -16px;
244
+ // padding: 20px;
245
+ border-bottom: 1px solid $borders_color;
246
+
247
+ .fs-plan
248
+ {
249
+
250
+ h3
251
+ {
252
+ margin-top: 0;
253
+ padding: 20px;
254
+ font-size: 16px;
255
+ }
256
+
257
+ .nav-tab-wrapper
258
+ {
259
+ border-bottom: 1px solid $borders_color;
260
+
261
+ .nav-tab
262
+ {
263
+ cursor: pointer;
264
+ position: relative;
265
+ padding: 0 10px;
266
+ font-size: 0.9em;
267
+
268
+ label
269
+ {
270
+ text-transform: uppercase;
271
+ color: green;
272
+ background: greenyellow;
273
+ position: absolute;
274
+ left: -1px;
275
+ right: -1px;
276
+ bottom: 100%;
277
+ border: 1px solid darkgreen;
278
+ padding: 2px;
279
+ text-align: center;
280
+ font-size: 0.9em;
281
+ line-height: 1em;
282
+ }
283
+
284
+ &.nav-tab-active
285
+ {
286
+ cursor: default;
287
+ background: $pricing_color;
288
+ border-bottom-color: $pricing_color;
289
+ }
290
+ }
291
+ }
292
+
293
+ &.fs-single-cycle
294
+ {
295
+ h3
296
+ {
297
+ background: $pricing_color;
298
+ margin: 0;
299
+ padding-bottom: 0;
300
+ color: #0073aa;
301
+ }
302
+
303
+ .nav-tab-wrapper,
304
+ .fs-billing-frequency
305
+ {
306
+ display: none;
307
+ }
308
+ }
309
+
310
+ .fs-pricing-body
311
+ {
312
+ background: $pricing_color;
313
+ padding: 20px;
314
+ }
315
+
316
+ .button
317
+ {
318
+ width: 100%;
319
+ text-align: center;
320
+ font-weight: bold;
321
+ text-transform: uppercase;
322
+ font-size: 1.1em;
323
+ }
324
+
325
+ label
326
+ {
327
+ white-space: nowrap;
328
+ }
329
+
330
+ var {
331
+ font-style: normal;
332
+ }
333
+
334
+ .fs-billing-frequency,
335
+ .fs-annual-discount
336
+ {
337
+ text-align: center;
338
+ display: block;
339
+ font-weight: bold;
340
+ margin-bottom: 10px;
341
+ text-transform: uppercase;
342
+ background: #F3F3F3;
343
+ padding: 2px;
344
+ border: 1px solid #ccc;
345
+ }
346
+
347
+ .fs-annual-discount
348
+ {
349
+ text-transform: none;
350
+ color: green;
351
+ background: greenyellow;
352
+ }
353
+
354
+ ul.fs-trial-terms
355
+ {
356
+ font-size: 0.9em;
357
+
358
+ i
359
+ {
360
+ float: left;
361
+ margin: 0 0 0 -15px;
362
+ }
363
+
364
+ li
365
+ {
366
+ margin: 10px 0 0 0;
367
+ }
368
+ }
369
+ }
370
+ }
371
+
372
+ #section-features
373
+ {
374
+ .fs-features
375
+ {
376
+ margin: -20px -26px;
377
+ }
378
+
379
+ table
380
+ {
381
+ width: 100%;
382
+ border-spacing: 0;
383
+ border-collapse: separate;
384
+
385
+ thead
386
+ {
387
+ th
388
+ {
389
+ padding: 10px 0;
390
+ }
391
+
392
+ .fs-price
393
+ {
394
+ color: $fs-logo-green-color;
395
+ font-weight: normal;
396
+ display: block;
397
+ text-align: center;
398
+ }
399
+ }
400
+
401
+ tbody
402
+ {
403
+ td
404
+ {
405
+ border-top: 1px solid #ccc;
406
+ padding: 10px 0;
407
+ text-align: center;
408
+ width: 100px;
409
+ color: $fs-logo-green-color;
410
+
411
+ &:first-child
412
+ {
413
+ text-align: left;
414
+ width: auto;
415
+ color: inherit;
416
+ padding-left: 26px;
417
+ }
418
+ }
419
+ tr.fs-odd
420
+ {
421
+ td
422
+ {
423
+ background: #fefefe;
424
+ }
425
+ }
426
+ }
427
+ }
428
+
429
+ .dashicons-yes
430
+ {
431
+ width: 30px;
432
+ height: 30px;
433
+ font-size: 30px;
434
+ }
435
+ }
436
+ }
437
+
438
+ @media screen and (max-width: 961px) {
439
+ #fs_addons
440
+ {
441
+ .fs-cards-list
442
+ {
443
+ .fs-card
444
+ {
445
+ height: 265px;
446
+ }
447
+ }
448
+ }
449
  }
includes/pum-sdk/freemius/assets/scss/admin/affiliation.scss CHANGED
@@ -1,97 +1,97 @@
1
- @import "../start";
2
-
3
- #fs_affiliation_content_wrapper {
4
- #messages {
5
- margin-top: 25px;
6
- }
7
-
8
- h3 {
9
- font-size: 24px;
10
- padding: 0;
11
- margin-left: 0;
12
- }
13
-
14
- ul {
15
- li {
16
- @include box-sizing(border-box);
17
- list-style-type: none;
18
-
19
- &:before {
20
- content: '✓';
21
- margin-right: 10px;
22
- font-weight: bold;
23
- }
24
- }
25
- }
26
-
27
- p:not(.description), li, label {
28
- font-size: 16px !important;
29
- line-height: 26px !important;
30
- }
31
-
32
- .button {
33
- margin-top: 20px;
34
- margin-bottom: 7px;
35
- line-height: 35px;
36
- height: 40px;
37
- font-size: 16px;
38
-
39
- &#cancel_button {
40
- margin-right: 5px;
41
- }
42
- }
43
-
44
- form {
45
- .input-container {
46
- .input-label {
47
- font-weight: bold;
48
- display: block;
49
- width: 100%;
50
- }
51
-
52
- &.input-container-text {
53
- label, input, textarea {
54
- display: block;
55
- }
56
- }
57
-
58
- margin-bottom: 15px;
59
-
60
- #add_domain, .remove-domain {
61
- text-decoration: none;
62
- display: inline-block;
63
- margin-top: 3px;
64
-
65
- &:focus {
66
- box-shadow: none;
67
- }
68
-
69
- &.disabled {
70
- color: #aaa;
71
- cursor: default;
72
- }
73
- }
74
- }
75
-
76
- #extra_domains_container {
77
- .description {
78
- margin-top: 0;
79
- position: relative;
80
- top: -4px;
81
- }
82
-
83
- .extra-domain-input-container {
84
- margin-bottom: 15px;
85
-
86
- .domain {
87
- display: inline-block;
88
- margin-right: 5px;
89
-
90
- &:last-of-type {
91
- margin-bottom: 0;
92
- }
93
- }
94
- }
95
- }
96
- }
97
  }
1
+ @import "../start";
2
+
3
+ #fs_affiliation_content_wrapper {
4
+ #messages {
5
+ margin-top: 25px;
6
+ }
7
+
8
+ h3 {
9
+ font-size: 24px;
10
+ padding: 0;
11
+ margin-left: 0;
12
+ }
13
+
14
+ ul {
15
+ li {
16
+ @include box-sizing(border-box);
17
+ list-style-type: none;
18
+
19
+ &:before {
20
+ content: '✓';
21
+ margin-right: 10px;
22
+ font-weight: bold;
23
+ }
24
+ }
25
+ }
26
+
27
+ p:not(.description), li, label {
28
+ font-size: 16px !important;
29
+ line-height: 26px !important;
30
+ }
31
+
32
+ .button {
33
+ margin-top: 20px;
34
+ margin-bottom: 7px;
35
+ line-height: 35px;
36
+ height: 40px;
37
+ font-size: 16px;
38
+
39
+ &#cancel_button {
40
+ margin-right: 5px;
41
+ }
42
+ }
43
+
44
+ form {
45
+ .input-container {
46
+ .input-label {
47
+ font-weight: bold;
48
+ display: block;
49
+ width: 100%;
50
+ }
51
+
52
+ &.input-container-text {
53
+ label, input, textarea {
54
+ display: block;
55
+ }
56
+ }
57
+
58
+ margin-bottom: 15px;
59
+
60
+ #add_domain, .remove-domain {
61
+ text-decoration: none;
62
+ display: inline-block;
63
+ margin-top: 3px;
64
+
65
+ &:focus {
66
+ box-shadow: none;
67
+ }
68
+
69
+ &.disabled {
70
+ color: #aaa;
71
+ cursor: default;
72
+ }
73
+ }
74
+ }
75
+
76
+ #extra_domains_container {
77
+ .description {
78
+ margin-top: 0;
79
+ position: relative;
80
+ top: -4px;
81
+ }
82
+
83
+ .extra-domain-input-container {
84
+ margin-bottom: 15px;
85
+
86
+ .domain {
87
+ display: inline-block;
88
+ margin-right: 5px;
89
+
90
+ &:last-of-type {
91
+ margin-bottom: 0;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
  }
includes/pum-sdk/freemius/assets/scss/admin/checkout.scss CHANGED
@@ -1,5 +1,5 @@
1
- @media screen and (max-width: 782px) {
2
- #wpbody-content {
3
- padding-bottom: 0 !important;
4
- }
5
  }
1
+ @media screen and (max-width: 782px) {
2
+ #wpbody-content {
3
+ padding-bottom: 0 !important;
4
+ }
5
  }
includes/pum-sdk/freemius/assets/scss/admin/common.scss CHANGED
@@ -1,7 +1,7 @@
1
  @import "../start";
2
  @import "themes";
3
 
4
- #iframe
5
  {
6
  line-height: 0;
7
  font-size: 0;
@@ -207,7 +207,7 @@ span.fs-submenu-item.fs-sub:before
207
  margin-right: 5px;
208
  vertical-align: sub;
209
  display: inline-block;
210
- background: url('../../../../../../../wp-admin/images/wpspin_light-2x.gif');
211
  background-size: contain;
212
  }
213
 
@@ -215,4 +215,6 @@ span.fs-submenu-item.fs-sub:before
215
  h2 {
216
  text-align: left;
217
  }
218
- }
 
 
1
  @import "../start";
2
  @import "themes";
3
 
4
+ #fs_frame
5
  {
6
  line-height: 0;
7
  font-size: 0;
207
  margin-right: 5px;
208
  vertical-align: sub;
209
  display: inline-block;
210
+ background: url('/wp-admin/images/wpspin_light-2x.gif');
211
  background-size: contain;
212
  }
213
 
215
  h2 {
216
  text-align: left;
217
  }
218
+ }
219
+
220
+ @import "plugin-upgrade-notice";
includes/pum-sdk/freemius/assets/scss/admin/debug.scss CHANGED
@@ -1,135 +1,135 @@
1
- @import "../start";
2
-
3
- .switch
4
- {
5
- position: relative;
6
- display: inline-block;
7
- font-size: 1.6em;
8
- font-weight: bold;
9
- color: #ccc;
10
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.8);
11
- height: 18px;
12
- padding: 6px 6px 5px 6px;
13
- border: 1px solid #ccc;
14
- border: 1px solid rgba(0, 0, 0, 0.2);
15
- border-radius: 4px;
16
- background: #ececec;
17
- box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1), inset 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
18
- cursor: pointer;
19
-
20
- span
21
- {
22
- display: inline-block; width: 35px;
23
- text-transform: uppercase;
24
-
25
- &.on
26
- {
27
- color: $button-primary-bkg;
28
- }
29
- }
30
-
31
- .toggle
32
- {
33
- position: absolute;
34
- top: 1px;
35
- width: 37px;
36
- height: 25px;
37
- border: 1px solid #ccc;
38
- border: 1px solid rgba(0, 0, 0, 0.3);
39
- border-radius: 4px;
40
- background: #fff;
41
- background: -moz-linear-gradient(top, #ececec 0%, #fff 100%);
42
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));
43
- background: -webkit-linear-gradient(top, #ececec 0%, #fff 100%);
44
- background: -o-linear-gradient(top, #ececec 0%, #fff 100%);
45
- background: -ms-linear-gradient(top, #ececec 0%, #fff 100%);
46
- background: linear-gradient(top, #ececec 0%, #fff 100%);
47
- box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.5);
48
- z-index: 999;
49
- @include transition(all 0.15s ease-in-out);
50
- }
51
-
52
- &.on .toggle
53
- {
54
- left: 2%;
55
- }
56
- &.off .toggle
57
- {
58
- left: 54%;
59
- }
60
-
61
- /* Round switch */
62
- &.round
63
- {
64
- padding: 0px 20px;
65
- border-radius: 40px;
66
-
67
- .toggle
68
- {
69
- border-radius: 40px;
70
- width: 14px;
71
- height: 14px;
72
- }
73
-
74
- &.on .toggle
75
- {
76
- left: 3%;
77
- background: $button-primary-bkg;
78
- }
79
- &.off .toggle
80
- {
81
- left: 58%;
82
- }
83
- }
84
- }
85
-
86
- .switch-label
87
- {
88
- font-size: 20px;
89
- line-height: 31px;
90
- margin: 0 5px;
91
- }
92
-
93
- #fs_log_book {
94
- table {
95
- font-family: Consolas,Monaco,monospace;
96
- font-size: 12px;
97
-
98
- th {
99
- color: #ccc;
100
- }
101
-
102
- tr {
103
- background: #232525;
104
-
105
- &.alternate {
106
- background: #2b2b2b;
107
- }
108
-
109
- td {
110
- &.fs-col--logger {
111
- color: #5a7435;
112
- }
113
- &.fs-col--type {
114
- color: #ffc861;
115
- }
116
- &.fs-col--function {
117
- color: #a7b7b1;
118
- font-weight: bold;
119
- }
120
- &.fs-col--message {
121
- &, a
122
- {
123
- color: #9a73ac !important;
124
- }
125
- }
126
- &.fs-col--file {
127
- color: #d07922;
128
- }
129
- &.fs-col--timestamp {
130
- color: #6596be;
131
- }
132
- }
133
- }
134
- }
135
  }
1
+ @import "../start";
2
+
3
+ .switch
4
+ {
5
+ position: relative;
6
+ display: inline-block;
7
+ font-size: 1.6em;
8
+ font-weight: bold;
9
+ color: #ccc;
10
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.8);
11
+ height: 18px;
12
+ padding: 6px 6px 5px 6px;
13
+ border: 1px solid #ccc;
14
+ border: 1px solid rgba(0, 0, 0, 0.2);
15
+ border-radius: 4px;
16
+ background: #ececec;
17
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1), inset 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
18
+ cursor: pointer;
19
+
20
+ span
21
+ {
22
+ display: inline-block; width: 35px;
23
+ text-transform: uppercase;
24
+
25
+ &.on
26
+ {
27
+ color: $button-primary-bkg;
28
+ }
29
+ }
30
+
31
+ .toggle
32
+ {
33
+ position: absolute;
34
+ top: 1px;
35
+ width: 37px;
36
+ height: 25px;
37
+ border: 1px solid #ccc;
38
+ border: 1px solid rgba(0, 0, 0, 0.3);
39
+ border-radius: 4px;
40
+ background: #fff;
41
+ background: -moz-linear-gradient(top, #ececec 0%, #fff 100%);
42
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));
43
+ background: -webkit-linear-gradient(top, #ececec 0%, #fff 100%);
44
+ background: -o-linear-gradient(top, #ececec 0%, #fff 100%);
45
+ background: -ms-linear-gradient(top, #ececec 0%, #fff 100%);
46
+ background: linear-gradient(top, #ececec 0%, #fff 100%);
47
+ box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.5);
48
+ z-index: 999;
49
+ @include transition(all 0.15s ease-in-out);
50
+ }
51
+
52
+ &.on .toggle
53
+ {
54
+ left: 2%;
55
+ }
56
+ &.off .toggle
57
+ {
58
+ left: 54%;
59
+ }
60
+
61
+ /* Round switch */
62
+ &.round
63
+ {
64
+ padding: 0px 20px;
65
+ border-radius: 40px;
66
+
67
+ .toggle
68
+ {
69
+ border-radius: 40px;
70
+ width: 14px;
71
+ height: 14px;
72
+ }
73
+
74
+ &.on .toggle
75
+ {
76
+ left: 3%;
77
+ background: $button-primary-bkg;
78
+ }
79
+ &.off .toggle
80
+ {
81
+ left: 58%;
82
+ }
83
+ }
84
+ }
85
+
86
+ .switch-label
87
+ {
88
+ font-size: 20px;
89
+ line-height: 31px;
90
+ margin: 0 5px;
91
+ }
92
+
93
+ #fs_log_book {
94
+ table {
95
+ font-family: Consolas,Monaco,monospace;
96
+ font-size: 12px;
97
+
98
+ th {
99
+ color: #ccc;
100
+ }
101
+
102
+ tr {
103
+ background: #232525;
104
+
105
+ &.alternate {
106
+ background: #2b2b2b;
107
+ }
108
+
109
+ td {
110
+ &.fs-col--logger {
111
+ color: #5a7435;
112
+ }
113
+ &.fs-col--type {
114
+ color: #ffc861;
115
+ }
116
+ &.fs-col--function {
117
+ color: #a7b7b1;
118
+ font-weight: bold;
119
+ }
120
+ &.fs-col--message {
121
+ &, a
122
+ {
123
+ color: #9a73ac !important;
124
+ }
125
+ }
126
+ &.fs-col--file {
127
+ color: #d07922;
128
+ }
129
+ &.fs-col--timestamp {
130
+ color: #6596be;
131
+ }
132
+ }
133
+ }
134
+ }
135
  }
includes/pum-sdk/freemius/assets/scss/admin/dialog-boxes.scss CHANGED
@@ -1,8 +1,10 @@
1
- @import "../start";
2
- @import "modal-common";
3
- @import "deactivation-feedback";
4
- @import "license-activation";
5
- @import "multisite-options";
6
- @import "license-key-resend";
7
- @import "ajax-loader";
8
- @import "auto-install";
 
 
1
+ @import "../start";
2
+ @import "modal-common";
3
+ @import "deactivation-feedback";
4
+ @import "subscription-cancellation";
5
+ @import "license-activation";
6
+ @import "multisite-options";
7
+ @import "license-key-resend";
8
+ @import "ajax-loader";
9
+ @import "auto-install";
10
+ @import "buttons";
includes/pum-sdk/freemius/assets/scss/admin/gdpr-optin-notice.scss CHANGED
@@ -1,17 +1,17 @@
1
- .fs-notice[data-id^="gdpr_optin_actions"]
2
- {
3
- .underlined {
4
- text-decoration: underline;
5
- }
6
-
7
- ul {
8
- .button, .action-description {
9
- vertical-align: middle;
10
- }
11
-
12
- .action-description {
13
- display: inline-block;
14
- margin-left: 3px;
15
- }
16
- }
17
  }
1
+ .fs-notice[data-id^="gdpr_optin_actions"]
2
+ {
3
+ .underlined {
4
+ text-decoration: underline;
5
+ }
6
+
7
+ ul {
8
+ .button, .action-description {
9
+ vertical-align: middle;
10
+ }
11
+
12
+ .action-description {
13
+ display: inline-block;
14
+ margin-left: 3px;
15
+ }
16
+ }
17
  }
includes/pum-sdk/freemius/assets/scss/admin/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/assets/scss/customizer.scss CHANGED
@@ -1,125 +1,125 @@
1
- @import "start";
2
-
3
- #fs_customizer_upsell {
4
- .fs-customizer-plan {
5
- padding: 10px 20px 20px 20px;
6
- border-radius: 3px;
7
- background: #fff;
8
-
9
- h2 {
10
- position: relative;
11
- margin: 0;
12
- line-height: 2em;
13
- text-transform: uppercase;
14
-
15
- .button-link {
16
- top: -2px;
17
- }
18
- }
19
- }
20
-
21
- .fs-feature {
22
- position: relative;
23
- }
24
-
25
- .dashicons-yes {
26
- color: #0085ba;
27
- font-size: 2em;
28
- vertical-align: bottom;
29
- margin-left: -7px;
30
- margin-right: 10px;
31
-
32
- .rtl & {
33
- margin-left: 10px;
34
- margin-right: -7px;
35
- }
36
- }
37
-
38
- .dashicons-editor-help
39
- {
40
- color: #bbb;
41
- cursor: help;
42
-
43
- $tooltip-color: #000;
44
-
45
- .fs-feature-desc {
46
- opacity: 0;
47
- visibility: hidden;
48
- @include transition(opacity 0.3s ease-in-out);
49
-
50
- position: absolute;
51
- background: $tooltip-color;
52
- color: #fff;
53
- font-family: 'arial', serif;
54
- font-size: 12px;
55
- padding: 10px;
56
- z-index: 999999;
57
- bottom: 100%;
58
- margin-bottom: 5px;
59
- left: 0;
60
- right: 0;
61
- @include border-radius(5px);
62
- @include box-shadow(1px 1px 1px rgba(0,0,0,0.2));
63
- line-height: 1.3em;
64
- font-weight: bold;
65
- text-align: left;
66
-
67
- .rtl &
68
- {
69
- text-align: right;
70
- }
71
-
72
- &::after {
73
- content: ' ';
74
- display: block;
75
- width: 0;
76
- height: 0;
77
- border-style: solid;
78
- border-width: 5px 5px 0 5px;
79
- border-color: $tooltip-color transparent transparent transparent;
80
- position: absolute;
81
- top: 100%;
82
- left: 21px;
83
-
84
- .rtl & {
85
- right: 21px;
86
- left: auto;
87
- }
88
- }
89
- }
90
-
91
- &:hover {
92
- .fs-feature-desc {
93
- visibility: visible;
94
- opacity: 1;
95
- }
96
- }
97
- }
98
-
99
- .button-primary {
100
- display: block;
101
- text-align: center;
102
- margin-top: 10px;
103
- }
104
- }
105
-
106
- #fs_customizer_support
107
- {
108
- display: block !important;
109
-
110
- .button {
111
- float: right;
112
- }
113
-
114
- .button-group {
115
- width: 100%;
116
- display: block;
117
- margin-top: 10px;
118
-
119
- .button {
120
- float: none;
121
- width: 50%;
122
- text-align: center;
123
- }
124
- }
125
  }
1
+ @import "start";
2
+
3
+ #fs_customizer_upsell {
4
+ .fs-customizer-plan {
5
+ padding: 10px 20px 20px 20px;
6
+ border-radius: 3px;
7
+ background: #fff;
8
+
9
+ h2 {
10
+ position: relative;
11
+ margin: 0;
12
+ line-height: 2em;
13
+ text-transform: uppercase;
14
+
15
+ .button-link {
16
+ top: -2px;
17
+ }
18
+ }
19
+ }
20
+
21
+ .fs-feature {
22
+ position: relative;
23
+ }
24
+
25
+ .dashicons-yes {
26
+ color: #0085ba;
27
+ font-size: 2em;
28
+ vertical-align: bottom;
29
+ margin-left: -7px;
30
+ margin-right: 10px;
31
+
32
+ .rtl & {
33
+ margin-left: 10px;
34
+ margin-right: -7px;
35
+ }
36
+ }
37
+
38
+ .dashicons-editor-help
39
+ {
40
+ color: #bbb;
41
+ cursor: help;
42
+
43
+ $tooltip-color: #000;
44
+
45
+ .fs-feature-desc {
46
+ opacity: 0;
47
+ visibility: hidden;
48
+ @include transition(opacity 0.3s ease-in-out);
49
+
50
+ position: absolute;
51
+ background: $tooltip-color;
52
+ color: #fff;
53
+ font-family: 'arial', serif;
54
+ font-size: 12px;
55
+ padding: 10px;
56
+ z-index: 999999;
57
+ bottom: 100%;
58
+ margin-bottom: 5px;
59
+ left: 0;
60
+ right: 0;
61
+ @include border-radius(5px);
62
+ @include box-shadow(1px 1px 1px rgba(0,0,0,0.2));
63
+ line-height: 1.3em;
64
+ font-weight: bold;
65
+ text-align: left;
66
+
67
+ .rtl &
68
+ {
69
+ text-align: right;
70
+ }
71
+
72
+ &::after {
73
+ content: ' ';
74
+ display: block;
75
+ width: 0;
76
+ height: 0;
77
+ border-style: solid;
78
+ border-width: 5px 5px 0 5px;
79
+ border-color: $tooltip-color transparent transparent transparent;
80
+ position: absolute;
81
+ top: 100%;
82
+ left: 21px;
83
+
84
+ .rtl & {
85
+ right: 21px;
86
+ left: auto;
87
+ }
88
+ }
89
+ }
90
+
91
+ &:hover {
92
+ .fs-feature-desc {
93
+ visibility: visible;
94
+ opacity: 1;
95
+ }
96
+ }
97
+ }
98
+
99
+ .button-primary {
100
+ display: block;
101
+ text-align: center;
102
+ margin-top: 10px;
103
+ }
104
+ }
105
+
106
+ #fs_customizer_support
107
+ {
108
+ display: block !important;
109
+
110
+ .button {
111
+ float: right;
112
+ }
113
+
114
+ .button-group {
115
+ width: 100%;
116
+ display: block;
117
+ margin-top: 10px;
118
+
119
+ .button {
120
+ float: none;
121
+ width: 50%;
122
+ text-align: center;
123
+ }
124
+ }
125
  }
includes/pum-sdk/freemius/assets/scss/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/composer.json CHANGED
@@ -1,10 +1,10 @@
1
- {
2
- "name": "freemius/wordpress-sdk",
3
- "description": "Freemius WordPress SDK",
4
- "keywords": ["freemius", "wordpress", "plugin", "sdk"],
5
- "homepage": "https://freemius.com",
6
- "license": "GPL-3.0-only",
7
- "require": {
8
- "php": ">=5.2"
9
- }
10
- }
1
+ {
2
+ "name": "freemius/wordpress-sdk",
3
+ "description": "Freemius WordPress SDK",
4
+ "keywords": ["freemius", "wordpress", "plugin", "sdk"],
5
+ "homepage": "https://freemius.com",
6
+ "license": "GPL-3.0-only",
7
+ "require": {
8
+ "php": ">=5.2"
9
+ }
10
+ }
includes/pum-sdk/freemius/config.php CHANGED
@@ -1,388 +1,388 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.4
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- if ( ! defined( 'WP_FS__SLUG' ) ) {
14
- define( 'WP_FS__SLUG', 'freemius' );
15
- }
16
- if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
17
- define( 'WP_FS__DEV_MODE', false );
18
- }
19
-
20
- #--------------------------------------------------------------------------------
21
- #region API Connectivity Issues Simulation
22
- #--------------------------------------------------------------------------------
23
-
24
- if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
25
- define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
26
- }
27
- if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
28
- define( 'WP_FS__SIMULATE_NO_CURL', false );
29
- }
30
- if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
31
- define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
32
- }
33
- if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
34
- define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
35
- }
36
- if ( WP_FS__SIMULATE_NO_CURL ) {
37
- define( 'FS_SDK__SIMULATE_NO_CURL', true );
38
- }
39
- if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
40
- define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
41
- }
42
- if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
43
- define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
44
- }
45
-
46
- #endregion
47
-
48
- if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
49
- define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
50
- }
51
-
52
- if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
53
- /**
54
- * @since 1.1.7.3
55
- * @author Vova Feldman (@svovaf)
56
- *
57
- * I'm not sure if shared servers periodically change IP, or the subdomain of the
58
- * admin dashboard. Also, I've seen sites that have strange loop of switching
59
- * between domains on a daily basis. Therefore, to eliminate the risk of
60
- * multiple unwanted connectivity test pings, temporary ignore domain or
61
- * server IP changes.
62
- */
63
- define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
64
- }
65
-
66
- /**
67
- * If your dev environment supports custom public network IP setup
68
- * like VVV, please update WP_FS__LOCALHOST_IP with your public IP
69
- * and uncomment it during dev.
70
- */
71
- if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) {
72
- // VVV default public network IP.
73
- define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' );
74
-
75
- // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
76
- }
77
-
78
- /**
79
- * If true and running with secret key, the opt-in process
80
- * will skip the email activation process which is invoked
81
- * when the email of the context user already exist in Freemius
82
- * database (as a security precaution, to prevent sharing user
83
- * secret with unauthorized entity).
84
- *
85
- * IMPORTANT:
86
- * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
87
- * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
88
- * CLOCK IS SYNCED.
89
- */
90
- if ( ! defined( 'WP_FS__SKIP_EMAIL_ACTIVATION' ) ) {
91
- define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false );
92
- }
93
-
94
-
95
- #--------------------------------------------------------------------------------
96
- #region Directories
97
- #--------------------------------------------------------------------------------
98
-
99
- if ( ! defined( 'WP_FS__DIR' ) ) {
100
- define( 'WP_FS__DIR', dirname( __FILE__ ) );
101
- }
102
- if ( ! defined( 'WP_FS__DIR_INCLUDES' ) ) {
103
- define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' );
104
- }
105
- if ( ! defined( 'WP_FS__DIR_TEMPLATES' ) ) {
106
- define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' );
107
- }
108
- if ( ! defined( 'WP_FS__DIR_ASSETS' ) ) {
109
- define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' );
110
- }
111
- if ( ! defined( 'WP_FS__DIR_CSS' ) ) {
112
- define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' );
113
- }
114
- if ( ! defined( 'WP_FS__DIR_JS' ) ) {
115
- define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' );
116
- }
117
- if ( ! defined( 'WP_FS__DIR_IMG' ) ) {
118
- define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' );
119
- }
120
- if ( ! defined( 'WP_FS__DIR_SDK' ) ) {
121
- define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' );
122
- }
123
-
124
- #endregion
125
-
126
- /**
127
- * Domain / URL / Address
128
- */
129
- define( 'WP_FS__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
130
- define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
131
- define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
132
-
133
- if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
134
- define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
135
- }
136
- if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
137
- define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
138
- }
139
-
140
- if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
141
- define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
142
- }
143
-
144
- #--------------------------------------------------------------------------------
145
- #region HTTP
146
- #--------------------------------------------------------------------------------
147
-
148
- if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
149
- define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
150
- }
151
-
152
- if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
153
- define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
154
- // Checks if CloudFlare's HTTPS (Flexible SSL support).
155
- isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
156
- 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
157
- ) ||
158
- // Check if HTTPS request.
159
- ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
160
- ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
161
- );
162
- }
163
-
164
- if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
165
- define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
166
- strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
167
- }
168
-
169
- if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
170
- define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
171
- }
172
-
173
- if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
174
- if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
175
- define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
176
- } else {
177
- define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
178
- is_string( WP_FS__REMOTE_ADDR ) &&
179
- ( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
180
- WP_FS__REMOTE_ADDR === '::1' )
181
- );
182
- }
183
- }
184
-
185
- if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
186
- define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
187
- false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
188
- }
189
-
190
- #endregion
191
-
192
- if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
193
- // By default, run with Freemius production servers.
194
- define( 'WP_FS__IS_PRODUCTION_MODE', true );
195
- }
196
-
197
- if ( ! defined( 'WP_FS__ADDRESS' ) ) {
198
- define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
199
- }
200
-
201
-
202
- #--------------------------------------------------------------------------------
203
- #region API
204
- #--------------------------------------------------------------------------------
205
-
206
- if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
207
- define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080' );
208
- }
209
- if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
210
- define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
211
- }
212
-
213
- // Set API address for local testing.
214
- if ( ! WP_FS__IS_PRODUCTION_MODE ) {
215
- if ( ! defined( 'FS_API__ADDRESS' ) ) {
216
- define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
217
- }
218
- if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
219
- define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
220
- }
221
- }
222
-
223
- #endregion
224
-
225
- #--------------------------------------------------------------------------------
226
- #region Checkout
227
- #--------------------------------------------------------------------------------
228
-
229
- if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
230
- define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
231
- }
232
-
233
- if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
234
- define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius-local.com:8080' );
235
- }
236
-
237
- if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
238
- define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
239
- }
240
-
241
- #endregion
242
-
243
- define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
244
-
245
- if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
246
- define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
247
- }
248
- if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
249
- define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
250
- }
251
- if ( ! defined( 'WP_FS__GDPR_OPTION_NAME' ) ) {
252
- define( 'WP_FS__GDPR_OPTION_NAME', WP_FS___OPTION_PREFIX . 'gdpr' );
253
- }
254
- define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
255
-
256
- /**
257
- * Module types
258
- *
259
- * @since 1.2.2
260
- */
261
- define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
262
- define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
263
-
264
- /**
265
- * Billing Frequencies
266
- */
267
- define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
268
- define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
269
- define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
270
-
271
- /**
272
- * Plans
273
- */
274
- define( 'WP_FS__PLAN_DEFAULT_PAID', false );
275
- define( 'WP_FS__PLAN_FREE', 'free' );
276
- define( 'WP_FS__PLAN_TRIAL', 'trial' );
277
-
278
- /**
279
- * Times in seconds
280
- */
281
- if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
282
- define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
283
- }
284
- if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
285
- define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
286
- }
287
- // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
288
- if ( ! defined( 'WP_FS__TIME_12_HOURS_IN_SEC' ) ) {
289
- define( 'WP_FS__TIME_12_HOURS_IN_SEC', 43200 );
290
- }
291
- if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
292
- define( 'WP_FS__TIME_24_HOURS_IN_SEC', WP_FS__TIME_12_HOURS_IN_SEC * 2 );
293
- }
294
- if ( ! defined( 'WP_FS__TIME_WEEK_IN_SEC' ) ) {
295
- define( 'WP_FS__TIME_WEEK_IN_SEC', 7 * WP_FS__TIME_24_HOURS_IN_SEC );
296
- }
297
-
298
- #--------------------------------------------------------------------------------
299
- #region Debugging
300
- #--------------------------------------------------------------------------------
301
-
302
- if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
303
- $debug_mode = get_option( 'fs_debug_mode', null );
304
-
305
- if ( $debug_mode === null ) {
306
- $debug_mode = false;
307
- add_option( 'fs_debug_mode', $debug_mode );
308
- }
309
-
310
- define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
311
- }
312
-
313
- if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
314
- define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
315
- }
316
- if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
317
- define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
318
- }
319
- if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
320
- define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
321
- }
322
-
323
- if ( WP_FS__ECHO_DEBUG_SDK ) {
324
- error_reporting( E_ALL );
325
- }
326
-
327
- #endregion
328
-
329
- if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
330
- define( 'WP_FS__SCRIPT_START_TIME', time() );
331
- }
332
- if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
333
- define( 'WP_FS__DEFAULT_PRIORITY', 10 );
334
- }
335
- if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
336
- define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
337
- }
338
-
339
- #--------------------------------------------------------------------------------
340
- #region Multisite Network
341
- #--------------------------------------------------------------------------------
342
-
343
- /**
344
- * Do not use this define directly, it will have the wrong value
345
- * during plugin uninstall/deletion when the inclusion of the plugin
346
- * is triggered due to registration with register_uninstall_hook().
347
- *
348
- * Instead, use fs_is_network_admin().
349
- *
350
- * @author Vova Feldman (@svovaf)
351
- */
352
- if ( ! defined( 'WP_FS__IS_NETWORK_ADMIN' ) ) {
353
- define( 'WP_FS__IS_NETWORK_ADMIN',
354
- is_network_admin() ||
355
- ( is_multisite() &&
356
- ( ( defined( 'DOING_AJAX' ) && DOING_AJAX &&
357
- ( isset( $_REQUEST['_fs_network_admin'] ) /*||
358
- ( ! empty( $_REQUEST['action'] ) && 'delete-plugin' === $_REQUEST['action'] )*/ )
359
- ) ||
360
- // Plugin uninstall.
361
- defined( 'WP_UNINSTALL_PLUGIN' ) )
362
- )
363
- );
364
- }
365
-
366
- /**
367
- * Do not use this define directly, it will have the wrong value
368
- * during plugin uninstall/deletion when the inclusion of the plugin
369
- * is triggered due to registration with register_uninstall_hook().
370
- *
371
- * Instead, use fs_is_blog_admin().
372
- *
373
- * @author Vova Feldman (@svovaf)
374
- */
375
- if ( ! defined( 'WP_FS__IS_BLOG_ADMIN' ) ) {
376
- define( 'WP_FS__IS_BLOG_ADMIN', is_blog_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['_fs_blog_admin'] ) ) );
377
- }
378
-
379
- if ( ! defined( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED' ) ) {
380
- // Set to true to show network level settings even if delegated to site admins.
381
- define( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED', false );
382
- }
383
-
384
- #endregion
385
-
386
- if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
- define( 'WP_FS__DEMO_MODE', false );
388
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.4
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( ! defined( 'WP_FS__SLUG' ) ) {
14
+ define( 'WP_FS__SLUG', 'freemius' );
15
+ }
16
+ if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
17
+ define( 'WP_FS__DEV_MODE', false );
18
+ }
19
+
20
+ #--------------------------------------------------------------------------------
21
+ #region API Connectivity Issues Simulation
22
+ #--------------------------------------------------------------------------------
23
+
24
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
25
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
26
+ }
27
+ if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
28
+ define( 'WP_FS__SIMULATE_NO_CURL', false );
29
+ }
30
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
31
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
32
+ }
33
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
34
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
35
+ }
36
+ if ( WP_FS__SIMULATE_NO_CURL ) {
37
+ define( 'FS_SDK__SIMULATE_NO_CURL', true );
38
+ }
39
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
40
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
41
+ }
42
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
43
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
44
+ }
45
+
46
+ #endregion
47
+
48
+ if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
49
+ define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
50
+ }
51
+
52
+ if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
53
+ /**
54
+ * @since 1.1.7.3
55
+ * @author Vova Feldman (@svovaf)
56
+ *
57
+ * I'm not sure if shared servers periodically change IP, or the subdomain of the
58
+ * admin dashboard. Also, I've seen sites that have strange loop of switching
59
+ * between domains on a daily basis. Therefore, to eliminate the risk of
60
+ * multiple unwanted connectivity test pings, temporary ignore domain or
61
+ * server IP changes.
62
+ */
63
+ define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
64
+ }
65
+
66
+ /**
67
+ * If your dev environment supports custom public network IP setup
68
+ * like VVV, please update WP_FS__LOCALHOST_IP with your public IP
69
+ * and uncomment it during dev.
70
+ */
71
+ if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) {
72
+ // VVV default public network IP.
73
+ define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' );
74
+
75
+ // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
76
+ }
77
+
78
+ /**
79
+ * If true and running with secret key, the opt-in process
80
+ * will skip the email activation process which is invoked
81
+ * when the email of the context user already exist in Freemius
82
+ * database (as a security precaution, to prevent sharing user
83
+ * secret with unauthorized entity).
84
+ *
85
+ * IMPORTANT:
86
+ * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
87
+ * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
88
+ * CLOCK IS SYNCED.
89
+ */
90
+ if ( ! defined( 'WP_FS__SKIP_EMAIL_ACTIVATION' ) ) {
91
+ define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false );
92
+ }
93
+
94
+
95
+ #--------------------------------------------------------------------------------
96
+ #region Directories
97
+ #--------------------------------------------------------------------------------
98
+
99
+ if ( ! defined( 'WP_FS__DIR' ) ) {
100
+ define( 'WP_FS__DIR', dirname( __FILE__ ) );
101
+ }
102
+ if ( ! defined( 'WP_FS__DIR_INCLUDES' ) ) {
103
+ define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' );
104
+ }
105
+ if ( ! defined( 'WP_FS__DIR_TEMPLATES' ) ) {
106
+ define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' );
107
+ }
108
+ if ( ! defined( 'WP_FS__DIR_ASSETS' ) ) {
109
+ define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' );
110
+ }
111
+ if ( ! defined( 'WP_FS__DIR_CSS' ) ) {
112
+ define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' );
113
+ }
114
+ if ( ! defined( 'WP_FS__DIR_JS' ) ) {
115
+ define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' );
116
+ }
117
+ if ( ! defined( 'WP_FS__DIR_IMG' ) ) {
118
+ define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' );
119
+ }
120
+ if ( ! defined( 'WP_FS__DIR_SDK' ) ) {
121
+ define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' );
122
+ }
123
+
124
+ #endregion
125
+
126
+ /**
127
+ * Domain / URL / Address
128
+ */
129
+ define( 'WP_FS__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
130
+ define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
131
+ define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
132
+
133
+ if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
134
+ define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
135
+ }
136
+ if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
137
+ define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
138
+ }
139
+
140
+ if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
141
+ define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
142
+ }
143
+
144
+ #--------------------------------------------------------------------------------
145
+ #region HTTP
146
+ #--------------------------------------------------------------------------------
147
+
148
+ if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
149
+ define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
150
+ }
151
+
152
+ if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
153
+ define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
154
+ // Checks if CloudFlare's HTTPS (Flexible SSL support).
155
+ isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
156
+ 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
157
+ ) ||
158
+ // Check if HTTPS request.
159
+ ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
160
+ ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
161
+ );
162
+ }
163
+
164
+ if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
165
+ define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
166
+ strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
167
+ }
168
+
169
+ if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
170
+ define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
171
+ }
172
+
173
+ if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
174
+ if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
175
+ define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
176
+ } else {
177
+ define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
178
+ is_string( WP_FS__REMOTE_ADDR ) &&
179
+ ( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
180
+ WP_FS__REMOTE_ADDR === '::1' )
181
+ );
182
+ }
183
+ }
184
+
185
+ if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
186
+ define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
187
+ false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
188
+ }
189
+
190
+ #endregion
191
+
192
+ if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
193
+ // By default, run with Freemius production servers.
194
+ define( 'WP_FS__IS_PRODUCTION_MODE', true );
195
+ }
196
+
197
+ if ( ! defined( 'WP_FS__ADDRESS' ) ) {
198
+ define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
199
+ }
200
+
201
+
202
+ #--------------------------------------------------------------------------------
203
+ #region API
204
+ #--------------------------------------------------------------------------------
205
+
206
+ if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
207
+ define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080' );
208
+ }
209
+ if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
210
+ define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
211
+ }
212
+
213
+ // Set API address for local testing.
214
+ if ( ! WP_FS__IS_PRODUCTION_MODE ) {
215
+ if ( ! defined( 'FS_API__ADDRESS' ) ) {
216
+ define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
217
+ }
218
+ if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
219
+ define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
220
+ }
221
+ }
222
+
223
+ #endregion
224
+
225
+ #--------------------------------------------------------------------------------
226
+ #region Checkout
227
+ #--------------------------------------------------------------------------------
228
+
229
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
230
+ define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
231
+ }
232
+
233
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
234
+ define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius-local.com:8080' );
235
+ }
236
+
237
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
238
+ define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
239
+ }
240
+
241
+ #endregion
242
+
243
+ define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
244
+
245
+ if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
246
+ define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
247
+ }
248
+ if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
249
+ define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
250
+ }
251
+ if ( ! defined( 'WP_FS__GDPR_OPTION_NAME' ) ) {
252
+ define( 'WP_FS__GDPR_OPTION_NAME', WP_FS___OPTION_PREFIX . 'gdpr' );
253
+ }
254
+ define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
255
+
256
+ /**
257
+ * Module types
258
+ *
259
+ * @since 1.2.2
260
+ */
261
+ define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
262
+ define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
263
+
264
+ /**
265
+ * Billing Frequencies
266
+ */
267
+ define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
268
+ define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
269
+ define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
270
+
271
+ /**
272
+ * Plans
273
+ */
274
+ define( 'WP_FS__PLAN_DEFAULT_PAID', false );
275
+ define( 'WP_FS__PLAN_FREE', 'free' );
276
+ define( 'WP_FS__PLAN_TRIAL', 'trial' );
277
+
278
+ /**
279
+ * Times in seconds
280
+ */
281
+ if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
282
+ define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
283
+ }
284
+ if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
285
+ define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
286
+ }
287
+ // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
288
+ if ( ! defined( 'WP_FS__TIME_12_HOURS_IN_SEC' ) ) {
289
+ define( 'WP_FS__TIME_12_HOURS_IN_SEC', 43200 );
290
+ }
291
+ if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
292
+ define( 'WP_FS__TIME_24_HOURS_IN_SEC', WP_FS__TIME_12_HOURS_IN_SEC * 2 );
293
+ }
294
+ if ( ! defined( 'WP_FS__TIME_WEEK_IN_SEC' ) ) {
295
+ define( 'WP_FS__TIME_WEEK_IN_SEC', 7 * WP_FS__TIME_24_HOURS_IN_SEC );
296
+ }
297
+
298
+ #--------------------------------------------------------------------------------
299
+ #region Debugging
300
+ #--------------------------------------------------------------------------------
301
+
302
+ if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
303
+ $debug_mode = get_option( 'fs_debug_mode', null );
304
+
305
+ if ( $debug_mode === null ) {
306
+ $debug_mode = false;
307
+ add_option( 'fs_debug_mode', $debug_mode );
308
+ }
309
+
310
+ define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
311
+ }
312
+
313
+ if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
314
+ define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
315
+ }
316
+ if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
317
+ define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
318
+ }
319
+ if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
320
+ define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
321
+ }
322
+
323
+ if ( WP_FS__ECHO_DEBUG_SDK ) {
324
+ error_reporting( E_ALL );
325
+ }
326
+
327
+ #endregion
328
+
329
+ if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
330
+ define( 'WP_FS__SCRIPT_START_TIME', time() );
331
+ }
332
+ if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
333
+ define( 'WP_FS__DEFAULT_PRIORITY', 10 );
334
+ }
335
+ if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
336
+ define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
337
+ }
338
+
339
+ #--------------------------------------------------------------------------------
340
+ #region Multisite Network
341
+ #--------------------------------------------------------------------------------
342
+
343
+ /**
344
+ * Do not use this define directly, it will have the wrong value
345
+ * during plugin uninstall/deletion when the inclusion of the plugin
346
+ * is triggered due to registration with register_uninstall_hook().
347
+ *
348
+ * Instead, use fs_is_network_admin().
349
+ *
350
+ * @author Vova Feldman (@svovaf)
351
+ */
352
+ if ( ! defined( 'WP_FS__IS_NETWORK_ADMIN' ) ) {
353
+ define( 'WP_FS__IS_NETWORK_ADMIN',
354
+ is_network_admin() ||
355
+ ( is_multisite() &&
356
+ ( ( defined( 'DOING_AJAX' ) && DOING_AJAX &&
357
+ ( isset( $_REQUEST['_fs_network_admin'] ) /*||
358
+ ( ! empty( $_REQUEST['action'] ) && 'delete-plugin' === $_REQUEST['action'] )*/ )
359
+ ) ||
360
+ // Plugin uninstall.
361
+ defined( 'WP_UNINSTALL_PLUGIN' ) )
362
+ )
363
+ );
364
+ }
365
+
366
+ /**
367
+ * Do not use this define directly, it will have the wrong value
368
+ * during plugin uninstall/deletion when the inclusion of the plugin
369
+ * is triggered due to registration with register_uninstall_hook().
370
+ *
371
+ * Instead, use fs_is_blog_admin().
372
+ *
373
+ * @author Vova Feldman (@svovaf)
374
+ */
375
+ if ( ! defined( 'WP_FS__IS_BLOG_ADMIN' ) ) {
376
+ define( 'WP_FS__IS_BLOG_ADMIN', is_blog_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['_fs_blog_admin'] ) ) );
377
+ }
378
+
379
+ if ( ! defined( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED' ) ) {
380
+ // Set to true to show network level settings even if delegated to site admins.
381
+ define( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED', false );
382
+ }
383
+
384
+ #endregion
385
+
386
+ if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
+ define( 'WP_FS__DEMO_MODE', false );
388
  }
includes/pum-sdk/freemius/includes/class-freemius-abstract.php CHANGED
@@ -1,597 +1,597 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
-
14
- /**
15
- * - Each instance of Freemius class represents a single plugin
16
- * install by a single user (the installer of the plugin).
17
- *
18
- * - Each website can only have one install of the same plugin.
19
- *
20
- * - Install entity is only created after a user connects his account with Freemius.
21
- *
22
- * Class Freemius_Abstract
23
- */
24
- abstract class Freemius_Abstract {
25
-
26
- #----------------------------------------------------------------------------------
27
- #region Identity
28
- #----------------------------------------------------------------------------------
29
-
30
- /**
31
- * Check if user has connected his account (opted-in).
32
- *
33
- * Note:
34
- * If the user opted-in and opted-out on a later stage,
35
- * this will still return true. If you want to check if the
36
- * user is currently opted-in, use:
37
- * `$fs->is_registered() && $fs->is_tracking_allowed()`
38
- *
39
- * @since 1.0.1
40
- * @return bool
41
- */
42
- abstract function is_registered();
43
-
44
- /**
45
- * Check if the user skipped connecting the account with Freemius.
46
- *
47
- * @since 1.0.7
48
- *
49
- * @return bool
50
- */
51
- abstract function is_anonymous();
52
-
53
- /**
54
- * Check if the user currently in activation mode.
55
- *
56
- * @since 1.0.7
57
- *
58
- * @return bool
59
- */
60
- abstract function is_activation_mode();
61
-
62
- #endregion
63
-
64
- #----------------------------------------------------------------------------------
65
- #region Usage Tracking
66
- #----------------------------------------------------------------------------------
67
-
68
- /**
69
- * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
70
- *
71
- * @author Leo Fajardo (@leorw)
72
- * @since 1.2.1.5
73
- *
74
- * @return bool
75
- */
76
- abstract function is_tracking_allowed();
77
-
78
- /**
79
- * Returns TRUE if the user never opted-in or manually opted-out.
80
- *
81
- * @author Vova Feldman (@svovaf)
82
- * @since 1.2.1.5
83
- *
84
- * @return bool
85
- */
86
- function is_tracking_prohibited() {
87
- return ! $this->is_registered() || ! $this->is_tracking_allowed();
88
- }
89
-
90
- /**
91
- * Opt-out from usage tracking.
92
- *
93
- * Note: This will not delete the account information but will stop all tracking.
94
- *
95
- * Returns:
96
- * 1. FALSE - If the user never opted-in.
97
- * 2. TRUE - If successfully opted-out.
98
- * 3. object - API Result on failure.
99
- *
100
- * @author Leo Fajardo (@leorw)
101
- * @since 1.2.1.5
102
- *
103
- * @return bool|object
104
- */
105
- abstract function stop_tracking();
106
-
107
- /**
108
- * Opt-in back into usage tracking.
109
- *
110
- * Note: This will only work if the user opted-in previously.
111
- *
112
- * Returns:
113
- * 1. FALSE - If the user never opted-in.
114
- * 2. TRUE - If successfully opted-in back to usage tracking.
115
- * 3. object - API result on failure.
116
- *
117
- * @author Leo Fajardo (@leorw)
118
- * @since 1.2.1.5
119
- *
120
- * @return bool|object
121
- */
122
- abstract function allow_tracking();
123
-
124
- #endregion
125
-
126
- #----------------------------------------------------------------------------------
127
- #region Module Type
128
- #----------------------------------------------------------------------------------
129
-
130
- /**
131
- * Checks if the plugin's type is "plugin". The other type is "theme".
132
- *
133
- * @author Leo Fajardo (@leorw)
134
- * @since 1.2.2
135
- *
136
- * @return bool
137
- */
138
- abstract function is_plugin();
139
-
140
- /**
141
- * Checks if the module type is "theme". The other type is "plugin".
142
- *
143
- * @author Leo Fajardo (@leorw)
144
- * @since 1.2.2
145
- *
146
- * @return bool
147
- */
148
- function is_theme() {
149
- return ( ! $this->is_plugin() );
150
- }
151
-
152
- #endregion
153
-
154
- #----------------------------------------------------------------------------------
155
- #region Permissions
156
- #----------------------------------------------------------------------------------
157
-
158
- /**
159
- * Check if plugin must be WordPress.org compliant.
160
- *
161
- * @since 1.0.7
162
- *
163
- * @return bool
164
- */
165
- abstract function is_org_repo_compliant();
166
-
167
- /**
168
- * Check if plugin is allowed to install executable files.
169
- *
170
- * @author Vova Feldman (@svovaf)
171
- * @since 1.0.5
172
- *
173
- * @return bool
174
- */
175
- function is_allowed_to_install() {
176
- return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
177
- }
178
-
179
- #endregion
180
-
181
- /**
182
- * Check if user in trial or in free plan (not paying).
183
- *
184
- * @author Vova Feldman (@svovaf)
185
- * @since 1.0.4
186
- *
187
- * @return bool
188
- */
189
- function is_not_paying() {
190
- return ( $this->is_trial() || $this->is_free_plan() );
191
- }
192
-
193
- /**
194
- * Check if the user has an activated and valid paid license on current plugin's install.
195
- *
196
- * @since 1.0.9
197
- *
198
- * @return bool
199
- */
200
- abstract function is_paying();
201
-
202
- /**
203
- * Check if the user is paying or in trial.
204
- *
205
- * @since 1.0.9
206
- *
207
- * @return bool
208
- */
209
- function is_paying_or_trial() {
210
- return ( $this->is_paying() || $this->is_trial() );
211
- }
212
-
213
- /**
214
- * Check if user in a trial or have feature enabled license.
215
- *
216
- * @author Vova Feldman (@svovaf)
217
- * @since 1.1.7
218
- *
219
- * @return bool
220
- */
221
- abstract function can_use_premium_code();
222
-
223
- #----------------------------------------------------------------------------------
224
- #region Premium Only
225
- #----------------------------------------------------------------------------------
226
-
227
- /**
228
- * All logic wrapped in methods with "__premium_only()" suffix will be only
229
- * included in the premium code.
230
- *
231
- * Example:
232
- * if ( freemius()->is__premium_only() ) {
233
- * ...
234
- * }
235
- */
236
-
237
- /**
238
- * Returns true when running premium plugin code.
239
- *
240
- * @since 1.0.9
241
- *
242
- * @return bool
243
- */
244
- function is__premium_only() {
245
- return $this->is_premium();
246
- }
247
-
248
- /**
249
- * Check if the user has an activated and valid paid license on current plugin's install.
250
- *
251
- * @since 1.0.9
252
- *
253
- * @return bool
254
- *
255
- */
256
- function is_paying__premium_only() {
257
- return ( $this->is__premium_only() && $this->is_paying() );
258
- }
259
-
260
- /**
261
- * All code wrapped in this statement will be only included in the premium code.
262
- *
263
- * @since 1.0.9
264
- *
265
- * @param string $plan Plan name.
266
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
267
- *
268
- * @return bool
269
- */
270
- function is_plan__premium_only( $plan, $exact = false ) {
271
- return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
272
- }
273
-
274
- /**
275
- * Check if plan matches active license' plan or active trial license' plan.
276
- *
277
- * All code wrapped in this statement will be only included in the premium code.
278
- *
279
- * @since 1.0.9
280
- *
281
- * @param string $plan Plan name.
282
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
283
- *
284
- * @return bool
285
- */
286
- function is_plan_or_trial__premium_only( $plan, $exact = false ) {
287
- return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
288
- }
289
-
290
- /**
291
- * Check if the user is paying or in trial.
292
- *
293
- * All code wrapped in this statement will be only included in the premium code.
294
- *
295
- * @since 1.0.9
296
- *
297
- * @return bool
298
- */
299
- function is_paying_or_trial__premium_only() {
300
- return $this->is_premium() && $this->is_paying_or_trial();
301
- }
302
-
303
- /**
304
- * Check if the user has an activated and valid paid license on current plugin's install.
305
- *
306
- * @since 1.0.4
307
- *
308
- * @return bool
309
- *
310
- * @deprecated Method name is confusing since it's not clear from the name the code will be removed.
311
- * @using Alias to is_paying__premium_only()
312
- */
313
- function is_paying__fs__() {
314
- return $this->is_paying__premium_only();
315
- }
316
-
317
- /**
318
- * Check if user in a trial or have feature enabled license.
319
- *
320
- * All code wrapped in this statement will be only included in the premium code.
321
- *
322
- * @author Vova Feldman (@svovaf)
323
- * @since 1.1.9
324
- *
325
- * @return bool
326
- */
327
- function can_use_premium_code__premium_only() {
328
- return $this->is_premium() && $this->can_use_premium_code();
329
- }
330
-
331
- #endregion
332
-
333
- #----------------------------------------------------------------------------------
334
- #region Trial
335
- #----------------------------------------------------------------------------------
336
-
337
- /**
338
- * Check if the user in a trial.
339
- *
340
- * @since 1.0.3
341
- *
342
- * @return bool
343
- */
344
- abstract function is_trial();
345
-
346
- /**
347
- * Check if trial already utilized.
348
- *
349
- * @since 1.0.9
350
- *
351
- * @return bool
352
- */
353
- abstract function is_trial_utilized();
354
-
355
- #endregion
356
-
357
- #----------------------------------------------------------------------------------
358
- #region Plans
359
- #----------------------------------------------------------------------------------
360
-
361
- /**
362
- * Check if the user is on the free plan of the product.
363
- *
364
- * @since 1.0.4
365
- *
366
- * @return bool
367
- */
368
- abstract function is_free_plan();
369
-
370
- /**
371
- * @since 1.0.2
372
- *
373
- * @param string $plan Plan name.
374
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
375
- *
376
- * @return bool
377
- */
378
- abstract function is_plan( $plan, $exact = false );
379
-
380
- /**
381
- * Check if plan based on trial. If not in trial mode, should return false.
382
- *
383
- * @since 1.0.9
384
- *
385
- * @param string $plan Plan name.
386
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
387
- *
388
- * @return bool
389
- */
390
- abstract function is_trial_plan( $plan, $exact = false );
391
-
392
- /**
393
- * Check if plan matches active license' plan or active trial license' plan.
394
- *
395
- * @since 1.0.9
396
- *
397
- * @param string $plan Plan name.
398
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
399
- *
400
- * @return bool
401
- */
402
- function is_plan_or_trial( $plan, $exact = false ) {
403
- return $this->is_plan( $plan, $exact ) ||
404
- $this->is_trial_plan( $plan, $exact );
405
- }
406
-
407
- /**
408
- * Check if plugin has any paid plans.
409
- *
410
- * @author Vova Feldman (@svovaf)
411
- * @since 1.0.7
412
- *
413
- * @return bool
414
- */
415
- abstract function has_paid_plan();
416
-
417
- /**
418
- * Check if plugin has any free plan, or is it premium only.
419
- *
420
- * Note: If no plans configured, assume plugin is free.
421
- *
422
- * @author Vova Feldman (@svovaf)
423
- * @since 1.0.7
424
- *
425
- * @return bool
426
- */
427
- abstract function has_free_plan();
428
-
429
- /**
430
- * Check if plugin is premium only (no free plans).
431
- *
432
- * NOTE: is__premium_only() is very different method, don't get confused.
433
- *
434
- * @author Vova Feldman (@svovaf)
435
- * @since 1.1.9
436
- *
437
- * @return bool
438
- */
439
- abstract function is_only_premium();
440
-
441
- /**
442
- * Check if module has a premium code version.
443
- *
444
- * Serviceware module might be freemium without any
445
- * premium code version, where the paid features
446
- * are all part of the service.
447
- *
448
- * @author Vova Feldman (@svovaf)
449
- * @since 1.2.1.6
450
- *
451
- * @return bool
452
- */
453
- abstract function has_premium_version();
454
-
455
- /**
456
- * Check if module has any release on Freemius,
457
- * or all plugin's code is on WordPress.org (Serviceware).
458
- *
459
- * @return bool
460
- */
461
- function has_release_on_freemius() {
462
- return ! $this->is_org_repo_compliant() ||
463
- $this->has_premium_version();
464
- }
465
-
466
- /**
467
- * Checks if it's a freemium plugin.
468
- *
469
- * @author Vova Feldman (@svovaf)
470
- * @since 1.1.9
471
- *
472
- * @return bool
473
- */
474
- function is_freemium() {
475
- return $this->has_paid_plan() &&
476
- $this->has_free_plan();
477
- }
478
-
479
- /**
480
- * Check if module has only one plan.
481
- *
482
- * @author Vova Feldman (@svovaf)
483
- * @since 1.2.1.7
484
- *
485
- * @return bool
486
- */
487
- abstract function is_single_plan();
488
-
489
- #endregion
490
-
491
- /**
492
- * Check if running payments in sandbox mode.
493
- *
494
- * @since 1.0.4
495
- *
496
- * @return bool
497
- */
498
- abstract function is_payments_sandbox();
499
-
500
- /**
501
- * Check if running test vs. live plugin.
502
- *
503
- * @since 1.0.5
504
- *
505
- * @return bool
506
- */
507
- abstract function is_live();
508
-
509
- /**
510
- * Check if running premium plugin code.
511
- *
512
- * @since 1.0.5
513
- *
514
- * @return bool
515
- */
516
- abstract function is_premium();
517
-
518
- /**
519
- * Get upgrade URL.
520
- *
521
- * @author Vova Feldman (@svovaf)
522
- * @since 1.0.2
523
- *
524
- * @param string $period Billing cycle.
525
- *
526
- * @return string
527
- */
528
- abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
529
-
530
- /**
531
- * Check if Freemius was first added in a plugin update.
532
- *
533
- * @author Vova Feldman (@svovaf)
534
- * @since 1.1.5
535
- *
536
- * @return bool
537
- */
538
- function is_plugin_update() {
539
- return ! $this->is_plugin_new_install();
540
- }
541
-
542
- /**
543
- * Check if Freemius was part of the plugin when the user installed it first.
544
- *
545
- * @author Vova Feldman (@svovaf)
546
- * @since 1.1.5
547
- *
548
- * @return bool
549
- */
550
- abstract function is_plugin_new_install();
551
-
552
- #----------------------------------------------------------------------------------
553
- #region Marketing
554
- #----------------------------------------------------------------------------------
555
-
556
- /**
557
- * Check if current user purchased any other plugins before.
558
- *
559
- * @author Vova Feldman (@svovaf)
560
- * @since 1.0.9
561
- *
562
- * @return bool
563
- */
564
- abstract function has_purchased_before();
565
-
566
- /**
567
- * Check if current user classified as an agency.
568
- *
569
- * @author Vova Feldman (@svovaf)
570
- * @since 1.0.9
571
- *
572
- * @return bool
573
- */
574
- abstract function is_agency();
575
-
576
- /**
577
- * Check if current user classified as a developer.
578
- *
579
- * @author Vova Feldman (@svovaf)
580
- * @since 1.0.9
581
- *
582
- * @return bool
583
- */
584
- abstract function is_developer();
585
-
586
- /**
587
- * Check if current user classified as a business.
588
- *
589
- * @author Vova Feldman (@svovaf)
590
- * @since 1.0.9
591
- *
592
- * @return bool
593
- */
594
- abstract function is_business();
595
-
596
- #endregion
597
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+
14
+ /**
15
+ * - Each instance of Freemius class represents a single plugin
16
+ * install by a single user (the installer of the plugin).
17
+ *
18
+ * - Each website can only have one install of the same plugin.
19
+ *
20
+ * - Install entity is only created after a user connects his account with Freemius.
21
+ *
22
+ * Class Freemius_Abstract
23
+ */
24
+ abstract class Freemius_Abstract {
25
+
26
+ #----------------------------------------------------------------------------------
27
+ #region Identity
28
+ #----------------------------------------------------------------------------------
29
+
30
+ /**
31
+ * Check if user has connected his account (opted-in).
32
+ *
33
+ * Note:
34
+ * If the user opted-in and opted-out on a later stage,
35
+ * this will still return true. If you want to check if the
36
+ * user is currently opted-in, use:
37
+ * `$fs->is_registered() && $fs->is_tracking_allowed()`
38
+ *
39
+ * @since 1.0.1
40
+ * @return bool
41
+ */
42
+ abstract function is_registered();
43
+
44
+ /**
45
+ * Check if the user skipped connecting the account with Freemius.
46
+ *
47
+ * @since 1.0.7
48
+ *
49
+ * @return bool
50
+ */
51
+ abstract function is_anonymous();
52
+
53
+ /**
54
+ * Check if the user currently in activation mode.
55
+ *
56
+ * @since 1.0.7
57
+ *
58
+ * @return bool
59
+ */
60
+ abstract function is_activation_mode();
61
+
62
+ #endregion
63
+
64
+ #----------------------------------------------------------------------------------
65
+ #region Usage Tracking
66
+ #----------------------------------------------------------------------------------
67
+
68
+ /**
69
+ * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
70
+ *
71
+ * @author Leo Fajardo (@leorw)
72
+ * @since 1.2.1.5
73
+ *
74
+ * @return bool
75
+ */
76
+ abstract function is_tracking_allowed();
77
+
78
+ /**
79
+ * Returns TRUE if the user never opted-in or manually opted-out.
80
+ *
81
+ * @author Vova Feldman (@svovaf)
82
+ * @since 1.2.1.5
83
+ *
84
+ * @return bool
85
+ */
86
+ function is_tracking_prohibited() {
87
+ return ! $this->is_registered() || ! $this->is_tracking_allowed();
88
+ }
89
+
90
+ /**
91
+ * Opt-out from usage tracking.
92
+ *
93
+ * Note: This will not delete the account information but will stop all tracking.
94
+ *
95
+ * Returns:
96
+ * 1. FALSE - If the user never opted-in.
97
+ * 2. TRUE - If successfully opted-out.
98
+ * 3. object - API Result on failure.
99
+ *
100
+ * @author Leo Fajardo (@leorw)
101
+ * @since 1.2.1.5
102
+ *
103
+ * @return bool|object
104
+ */
105
+ abstract function stop_tracking();
106
+
107
+ /**
108
+ * Opt-in back into usage tracking.
109
+ *
110
+ * Note: This will only work if the user opted-in previously.
111
+ *
112
+ * Returns:
113
+ * 1. FALSE - If the user never opted-in.
114
+ * 2. TRUE - If successfully opted-in back to usage tracking.
115
+ * 3. object - API result on failure.
116
+ *
117
+ * @author Leo Fajardo (@leorw)
118
+ * @since 1.2.1.5
119
+ *
120
+ * @return bool|object
121
+ */
122
+ abstract function allow_tracking();
123
+
124
+ #endregion
125
+
126
+ #----------------------------------------------------------------------------------
127
+ #region Module Type
128
+ #----------------------------------------------------------------------------------
129
+
130
+ /**
131
+ * Checks if the plugin's type is "plugin". The other type is "theme".
132
+ *
133
+ * @author Leo Fajardo (@leorw)
134
+ * @since 1.2.2
135
+ *
136
+ * @return bool
137
+ */
138
+ abstract function is_plugin();
139
+
140
+ /**
141
+ * Checks if the module type is "theme". The other type is "plugin".
142
+ *
143
+ * @author Leo Fajardo (@leorw)
144
+ * @since 1.2.2
145
+ *
146
+ * @return bool
147
+ */
148
+ function is_theme() {
149
+ return ( ! $this->is_plugin() );
150
+ }
151
+
152
+ #endregion
153
+
154
+ #----------------------------------------------------------------------------------
155
+ #region Permissions
156
+ #----------------------------------------------------------------------------------
157
+
158
+ /**
159
+ * Check if plugin must be WordPress.org compliant.
160
+ *
161
+ * @since 1.0.7
162
+ *
163
+ * @return bool
164
+ */
165
+ abstract function is_org_repo_compliant();
166
+
167
+ /**
168
+ * Check if plugin is allowed to install executable files.
169
+ *
170
+ * @author Vova Feldman (@svovaf)
171
+ * @since 1.0.5
172
+ *
173
+ * @return bool
174
+ */
175
+ function is_allowed_to_install() {
176
+ return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
177
+ }
178
+
179
+ #endregion
180
+
181
+ /**
182
+ * Check if user in trial or in free plan (not paying).
183
+ *
184
+ * @author Vova Feldman (@svovaf)
185
+ * @since 1.0.4
186
+ *
187
+ * @return bool
188
+ */
189
+ function is_not_paying() {
190
+ return ( $this->is_trial() || $this->is_free_plan() );
191
+ }
192
+
193
+ /**
194
+ * Check if the user has an activated and valid paid license on current plugin's install.
195
+ *
196
+ * @since 1.0.9
197
+ *
198
+ * @return bool
199
+ */
200
+ abstract function is_paying();
201
+
202
+ /**
203
+ * Check if the user is paying or in trial.
204
+ *
205
+ * @since 1.0.9
206
+ *
207
+ * @return bool
208
+ */
209
+ function is_paying_or_trial() {
210
+ return ( $this->is_paying() || $this->is_trial() );
211
+ }
212
+
213
+ /**
214
+ * Check if user in a trial or have feature enabled license.
215
+ *
216
+ * @author Vova Feldman (@svovaf)
217
+ * @since 1.1.7
218
+ *
219
+ * @return bool
220
+ */
221
+ abstract function can_use_premium_code();
222
+
223
+ #----------------------------------------------------------------------------------
224
+ #region Premium Only
225
+ #----------------------------------------------------------------------------------
226
+
227
+ /**
228
+ * All logic wrapped in methods with "__premium_only()" suffix will be only
229
+ * included in the premium code.
230
+ *
231
+ * Example:
232
+ * if ( freemius()->is__premium_only() ) {
233
+ * ...
234
+ * }
235
+ */
236
+
237
+ /**
238
+ * Returns true when running premium plugin code.
239
+ *
240
+ * @since 1.0.9
241
+ *
242
+ * @return bool
243
+ */
244
+ function is__premium_only() {
245
+ return $this->is_premium();
246
+ }
247
+
248
+ /**
249
+ * Check if the user has an activated and valid paid license on current plugin's install.
250
+ *
251
+ * @since 1.0.9
252
+ *
253
+ * @return bool
254
+ *
255
+ */
256
+ function is_paying__premium_only() {
257
+ return ( $this->is__premium_only() && $this->is_paying() );
258
+ }
259
+
260
+ /**
261
+ * All code wrapped in this statement will be only included in the premium code.
262
+ *
263
+ * @since 1.0.9
264
+ *
265
+ * @param string $plan Plan name.
266
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
267
+ *
268
+ * @return bool
269
+ */
270
+ function is_plan__premium_only( $plan, $exact = false ) {
271
+ return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
272
+ }
273
+
274
+ /**
275
+ * Check if plan matches active license' plan or active trial license' plan.
276
+ *
277
+ * All code wrapped in this statement will be only included in the premium code.
278
+ *
279
+ * @since 1.0.9
280
+ *
281
+ * @param string $plan Plan name.
282
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
283
+ *
284
+ * @return bool
285
+ */
286
+ function is_plan_or_trial__premium_only( $plan, $exact = false ) {
287
+ return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
288
+ }
289
+
290
+ /**
291
+ * Check if the user is paying or in trial.
292
+ *
293
+ * All code wrapped in this statement will be only included in the premium code.
294
+ *
295
+ * @since 1.0.9
296
+ *
297
+ * @return bool
298
+ */
299
+ function is_paying_or_trial__premium_only() {
300
+ return $this->is_premium() && $this->is_paying_or_trial();
301
+ }
302
+
303
+ /**
304
+ * Check if the user has an activated and valid paid license on current plugin's install.
305
+ *
306
+ * @since 1.0.4
307
+ *
308
+ * @return bool
309
+ *
310
+ * @deprecated Method name is confusing since it's not clear from the name the code will be removed.
311
+ * @using Alias to is_paying__premium_only()
312
+ */
313
+ function is_paying__fs__() {
314
+ return $this->is_paying__premium_only();
315
+ }
316
+
317
+ /**
318
+ * Check if user in a trial or have feature enabled license.
319
+ *
320
+ * All code wrapped in this statement will be only included in the premium code.
321
+ *
322
+ * @author Vova Feldman (@svovaf)
323
+ * @since 1.1.9
324
+ *
325
+ * @return bool
326
+ */
327
+ function can_use_premium_code__premium_only() {
328
+ return $this->is_premium() && $this->can_use_premium_code();
329
+ }
330
+
331
+ #endregion
332
+
333
+ #----------------------------------------------------------------------------------
334
+ #region Trial
335
+ #----------------------------------------------------------------------------------
336
+
337
+ /**
338
+ * Check if the user in a trial.
339
+ *
340
+ * @since 1.0.3
341
+ *
342
+ * @return bool
343
+ */
344
+ abstract function is_trial();
345
+
346
+ /**
347
+ * Check if trial already utilized.
348
+ *
349
+ * @since 1.0.9
350
+ *
351
+ * @return bool
352
+ */
353
+ abstract function is_trial_utilized();
354
+
355
+ #endregion
356
+
357
+ #----------------------------------------------------------------------------------
358
+ #region Plans
359
+ #----------------------------------------------------------------------------------
360
+
361
+ /**
362
+ * Check if the user is on the free plan of the product.
363
+ *
364
+ * @since 1.0.4
365
+ *
366
+ * @return bool
367
+ */
368
+ abstract function is_free_plan();
369
+
370
+ /**
371
+ * @since 1.0.2
372
+ *
373
+ * @param string $plan Plan name.
374
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
375
+ *
376
+ * @return bool
377
+ */
378
+ abstract function is_plan( $plan, $exact = false );
379
+
380
+ /**
381
+ * Check if plan based on trial. If not in trial mode, should return false.
382
+ *
383
+ * @since 1.0.9
384
+ *
385
+ * @param string $plan Plan name.
386
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
387
+ *
388
+ * @return bool
389
+ */
390
+ abstract function is_trial_plan( $plan, $exact = false );
391
+
392
+ /**
393
+ * Check if plan matches active license' plan or active trial license' plan.
394
+ *
395
+ * @since 1.0.9
396
+ *
397
+ * @param string $plan Plan name.
398
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
399
+ *
400
+ * @return bool
401
+ */
402
+ function is_plan_or_trial( $plan, $exact = false ) {
403
+ return $this->is_plan( $plan, $exact ) ||
404
+ $this->is_trial_plan( $plan, $exact );
405
+ }
406
+
407
+ /**
408
+ * Check if plugin has any paid plans.
409
+ *
410
+ * @author Vova Feldman (@svovaf)
411
+ * @since 1.0.7
412
+ *
413
+ * @return bool
414
+ */
415
+ abstract function has_paid_plan();
416
+
417
+ /**
418
+ * Check if plugin has any free plan, or is it premium only.
419
+ *
420
+ * Note: If no plans configured, assume plugin is free.
421
+ *
422
+ * @author Vova Feldman (@svovaf)
423
+ * @since 1.0.7
424
+ *
425
+ * @return bool
426
+ */
427
+ abstract function has_free_plan();
428
+
429
+ /**
430
+ * Check if plugin is premium only (no free plans).
431
+ *
432
+ * NOTE: is__premium_only() is very different method, don't get confused.
433
+ *
434
+ * @author Vova Feldman (@svovaf)
435
+ * @since 1.1.9
436
+ *
437
+ * @return bool
438
+ */
439
+ abstract function is_only_premium();
440
+
441
+ /**
442
+ * Check if module has a premium code version.
443
+ *
444
+ * Serviceware module might be freemium without any
445
+ * premium code version, where the paid features
446
+ * are all part of the service.
447
+ *
448
+ * @author Vova Feldman (@svovaf)
449
+ * @since 1.2.1.6
450
+ *
451
+ * @return bool
452
+ */
453
+ abstract function has_premium_version();
454
+
455
+ /**
456
+ * Check if module has any release on Freemius,
457
+ * or all plugin's code is on WordPress.org (Serviceware).
458
+ *
459
+ * @return bool
460
+ */
461
+ function has_release_on_freemius() {
462
+ return ! $this->is_org_repo_compliant() ||
463
+ $this->has_premium_version();
464
+ }
465
+
466
+ /**
467
+ * Checks if it's a freemium plugin.
468
+ *
469
+ * @author Vova Feldman (@svovaf)
470
+ * @since 1.1.9
471
+ *
472
+ * @return bool
473
+ */
474
+ function is_freemium() {
475
+ return $this->has_paid_plan() &&
476
+ $this->has_free_plan();
477
+ }
478
+
479
+ /**
480
+ * Check if module has only one plan.
481
+ *
482
+ * @author Vova Feldman (@svovaf)
483
+ * @since 1.2.1.7
484
+ *
485
+ * @return bool
486
+ */
487
+ abstract function is_single_plan();
488
+
489
+ #endregion
490
+
491
+ /**
492
+ * Check if running payments in sandbox mode.
493
+ *
494
+ * @since 1.0.4
495
+ *
496
+ * @return bool
497
+ */
498
+ abstract function is_payments_sandbox();
499
+
500
+ /**
501
+ * Check if running test vs. live plugin.
502
+ *
503
+ * @since 1.0.5
504
+ *
505
+ * @return bool
506
+ */
507
+ abstract function is_live();
508
+
509
+ /**
510
+ * Check if running premium plugin code.
511
+ *
512
+ * @since 1.0.5
513
+ *
514
+ * @return bool
515
+ */
516
+ abstract function is_premium();
517
+
518
+ /**
519
+ * Get upgrade URL.
520
+ *
521
+ * @author Vova Feldman (@svovaf)
522
+ * @since 1.0.2
523
+ *
524
+ * @param string $period Billing cycle.
525
+ *
526
+ * @return string
527
+ */
528
+ abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
529
+
530
+ /**
531
+ * Check if Freemius was first added in a plugin update.
532
+ *
533
+ * @author Vova Feldman (@svovaf)
534
+ * @since 1.1.5
535
+ *
536
+ * @return bool
537
+ */
538
+ function is_plugin_update() {
539
+ return ! $this->is_plugin_new_install();
540
+ }
541
+
542
+ /**
543
+ * Check if Freemius was part of the plugin when the user installed it first.
544
+ *
545
+ * @author Vova Feldman (@svovaf)
546
+ * @since 1.1.5
547
+ *
548
+ * @return bool
549
+ */
550
+ abstract function is_plugin_new_install();
551
+
552
+ #----------------------------------------------------------------------------------
553
+ #region Marketing
554
+ #----------------------------------------------------------------------------------
555
+
556
+ /**
557
+ * Check if current user purchased any other plugins before.
558
+ *
559
+ * @author Vova Feldman (@svovaf)
560
+ * @since 1.0.9
561
+ *
562
+ * @return bool
563
+ */
564
+ abstract function has_purchased_before();
565
+
566
+ /**
567
+ * Check if current user classified as an agency.
568
+ *
569
+ * @author Vova Feldman (@svovaf)
570
+ * @since 1.0.9
571
+ *
572
+ * @return bool
573
+ */
574
+ abstract function is_agency();
575
+
576
+ /**
577
+ * Check if current user classified as a developer.
578
+ *
579
+ * @author Vova Feldman (@svovaf)
580
+ * @since 1.0.9
581
+ *
582
+ * @return bool
583
+ */
584
+ abstract function is_developer();
585
+
586
+ /**
587
+ * Check if current user classified as a business.
588
+ *
589
+ * @author Vova Feldman (@svovaf)
590
+ * @since 1.0.9
591
+ *
592
+ * @return bool
593
+ */
594
+ abstract function is_business();
595
+
596
+ #endregion
597
  }
includes/pum-sdk/freemius/includes/class-freemius.php CHANGED
@@ -33,6 +33,12 @@
33
  * @var string
34
  */
35
  private $_plugin_basename;
 
 
 
 
 
 
36
  /**
37
  * @since 1.0.0
38
  *
@@ -671,11 +677,12 @@
671
  version_compare( $sdk_version, '1.2.3', '>=' )
672
  ) {
673
  /**
674
- * Starting from version 1.2.3, paths are stored as relative paths and not absolute paths; so when upgrading to 1.2.3, make paths relative.
 
675
  *
676
  * @author Leo Fajardo (@leorw)
677
  */
678
- $this->make_paths_relative();
679
  }
680
 
681
  if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
@@ -699,6 +706,25 @@
699
 
700
  }
701
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
702
  }
703
 
704
  /**
@@ -824,30 +850,12 @@
824
  }
825
 
826
  /**
827
- * Makes paths relative.
828
  *
829
  * @author Leo Fajardo (@leorw)
830
  * @since 1.2.3
831
  */
832
- private function make_paths_relative() {
833
- $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
834
-
835
- if ( isset( $id_slug_type_path_map[ $this->_module_id ]['path'] ) ) {
836
- $id_slug_type_path_map[ $this->_module_id ]['path'] = $this->get_relative_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
837
-
838
- self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
839
- }
840
-
841
- if ( isset( $this->_storage->plugin_main_file ) ) {
842
- $plugin_main_file = $this->_storage->plugin_main_file;
843
-
844
- if ( isset( $plugin_main_file->path ) ) {
845
- $this->_storage->plugin_main_file->path = $this->get_relative_path( $this->_storage->plugin_main_file->path );
846
- } else if ( isset( $plugin_main_file->prev_path ) ) {
847
- $this->_storage->plugin_main_file->prev_path = $this->get_relative_path( $this->_storage->plugin_main_file->prev_path );
848
- }
849
- }
850
-
851
  // Remove invalid path that is still associated with the current slug if there's any.
852
  $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
853
  foreach ( $file_slug_map as $plugin_basename => $slug ) {
@@ -1230,6 +1238,22 @@
1230
  <?php
1231
  }
1232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1233
  /**
1234
  * @author Vova Feldman (@svovaf)
1235
  * @since 1.0.9
@@ -1241,6 +1265,26 @@
1241
  add_action( 'plugins_loaded', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
1242
 
1243
  if ( $this->is_plugin() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
  $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
1245
 
1246
  /**
@@ -1348,7 +1392,10 @@
1348
  add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1349
  }
1350
 
1351
- if ( $this->is_theme() && self::is_customizer() ) {
 
 
 
1352
  // Register customizer upsell.
1353
  add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1354
  }
@@ -1405,6 +1452,84 @@
1405
  }
1406
  }
1407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1408
  /**
1409
  * Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
1410
  * could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
@@ -1425,23 +1550,37 @@
1425
 
1426
  /**
1427
  * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
 
 
1428
  */
1429
- private function clear_module_main_file_cache() {
1430
  if ( ! isset( $this->_storage->plugin_main_file ) ||
1431
- empty( $this->_storage->plugin_main_file->path )
1432
  ) {
1433
  return;
1434
  }
1435
 
1436
- $plugin_main_file = clone $this->_storage->plugin_main_file;
 
 
 
 
 
 
 
 
 
 
 
1437
 
1438
- // Store cached path (2nd layer cache).
1439
- $plugin_main_file->prev_path = $plugin_main_file->path;
1440
 
1441
- // Clear cached path.
1442
- unset( $plugin_main_file->path );
1443
 
1444
- $this->_storage->plugin_main_file = $plugin_main_file;
 
1445
 
1446
  /**
1447
  * Clear global cached path.
@@ -1488,12 +1627,10 @@
1488
  array( &$this, '_submit_uninstall_reason_action' )
1489
  );
1490
 
1491
- if ( $this->is_theme() && $this->is_premium() && ! $this->has_active_valid_license() ) {
1492
- $this->add_ajax_action(
1493
- 'delete_theme_update_data',
1494
- array( &$this, '_delete_theme_update_data_action' )
1495
- );
1496
- }
1497
 
1498
  if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
1499
  if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
@@ -1619,7 +1756,7 @@
1619
 
1620
  return fs_normalize_path( trailingslashit( $is_plugin ?
1621
  WP_PLUGIN_DIR :
1622
- get_theme_root() ) );
1623
  }
1624
 
1625
  /**
@@ -1684,11 +1821,11 @@
1684
  private function get_caller_main_file_and_type() {
1685
  self::require_plugin_essentials();
1686
 
1687
- $all_plugins = get_plugins();
1688
  $all_plugins_paths = array();
1689
 
1690
  // Get active plugin's main files real full names (might be symlinks).
1691
- foreach ( $all_plugins as $relative_path => &$data ) {
1692
  if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
1693
  /**
1694
  * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
@@ -1706,7 +1843,7 @@
1706
  $caller_file_candidate = false;
1707
  $caller_map = array();
1708
  $module_type = WP_FS__MODULE_TYPE_PLUGIN;
1709
- $themes_dir = fs_normalize_path( get_theme_root() );
1710
 
1711
  for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
1712
  if ( empty( $bt[ $i ]['file'] ) ) {
@@ -1726,7 +1863,10 @@
1726
  'requir' . 'e_once',
1727
  'requir' . 'e',
1728
  'includ' . 'e_once',
1729
- 'includ' . 'e'
 
 
 
1730
  ) )
1731
  ) {
1732
  // Ignore call stack hooks and files inclusion.
@@ -2062,6 +2202,51 @@
2062
  exit;
2063
  }
2064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2065
  /**
2066
  * @author Leo Fajardo (@leorw)
2067
  * @since 2.0.2
@@ -2138,16 +2323,18 @@
2138
  * @since 1.2.2
2139
  *
2140
  * @param string|number $id_or_slug
 
2141
  *
2142
  * @return number|false
2143
  */
2144
- private static function get_module_id( $id_or_slug ) {
2145
  if ( is_numeric( $id_or_slug ) ) {
2146
  return $id_or_slug;
2147
  }
2148
 
2149
  foreach ( self::$_instances as $instance ) {
2150
- if ( $instance->is_plugin() && ( $id_or_slug === $instance->get_slug() ) ) {
 
2151
  return $instance->get_id();
2152
  }
2153
  }
@@ -2174,15 +2361,16 @@
2174
  * @author Vova Feldman (@svovaf)
2175
  * @since 1.0.1
2176
  *
2177
- * @param $plugin_file
 
2178
  *
2179
  * @return false|Freemius
2180
  */
2181
- static function get_instance_by_file( $plugin_file ) {
2182
  $slug = self::find_slug_by_basename( $plugin_file );
2183
 
2184
  return ( false !== $slug ) ?
2185
- self::instance( self::get_module_id( $slug ) ) :
2186
  false;
2187
  }
2188
 
@@ -2296,10 +2484,13 @@
2296
  function is_site_activation_mode( $and_on = true ) {
2297
  return (
2298
  ( $this->is_on() || ! $and_on ) &&
2299
- ( ! $this->is_registered() ||
2300
- ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) &&
2301
- ( ! $this->is_enable_anonymous() ||
2302
- ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
 
 
 
2303
  );
2304
  }
2305
 
@@ -2334,7 +2525,7 @@
2334
  return false;
2335
  }
2336
 
2337
- if ( $this->is_network_anonymous() ) {
2338
  // Super-admin skipped the connection network wide -> not activation mode.
2339
  return false;
2340
  }
@@ -2455,7 +2646,7 @@
2455
  self::require_plugin_essentials();
2456
 
2457
  $active_plugin = array();
2458
- $all_plugins = get_plugins();
2459
  $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
2460
 
2461
  foreach ( $active_plugins_basenames as $plugin_basename ) {
@@ -2481,6 +2672,11 @@
2481
  get_option( 'active_plugins' );
2482
 
2483
  $active = array();
 
 
 
 
 
2484
  foreach ( $active_basenames as $basename ) {
2485
  $active[ $basename ] = array(
2486
  'is_active' => true,
@@ -2505,7 +2701,7 @@
2505
  private static function get_all_plugins( $blog_id = 0 ) {
2506
  self::require_plugin_essentials();
2507
 
2508
- $all_plugins = get_plugins();
2509
 
2510
  $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
2511
 
@@ -2537,7 +2733,7 @@
2537
  private static function get_network_plugins() {
2538
  self::require_plugin_essentials();
2539
 
2540
- $all_plugins = get_plugins();
2541
 
2542
  $network_active_basenames = is_multisite() ?
2543
  get_site_option( 'active_sitewide_plugins' ) :
@@ -2634,26 +2830,28 @@
2634
  self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
2635
 
2636
  if ( is_multisite() ) {
 
 
 
 
 
 
 
2637
  /**
2638
- * If the id_slug_type_path_map exists on the site level but doesn't exist on the
2639
  * network level storage, it means that we need to process the storage with migration.
2640
  *
2641
- * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, id_slug_type_path_map will be already set in the network level storage.
2642
  *
2643
  * @author Vova Feldman (@svovaf)
2644
  * @since 2.0.0
2645
  */
2646
- if ( null === self::$_accounts->get_option( 'id_slug_type_path_map', null, true ) &&
2647
- null !== self::$_accounts->get_option( 'id_slug_type_path_map', null, false )
 
 
2648
  ) {
2649
- self::migrate_accounts_to_network();
2650
-
2651
- // Migrate API options from site level to network level.
2652
- $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
2653
- $api_network_options->migrate_to_network();
2654
-
2655
- // Migrate API cache to network level storage.
2656
- FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
2657
  }
2658
  }
2659
 
@@ -2679,10 +2877,30 @@
2679
  }
2680
 
2681
  add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
 
 
2682
 
2683
  self::$_statics_loaded = true;
2684
  }
2685
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2686
  #----------------------------------------------------------------------------------
2687
  #region Localization
2688
  #----------------------------------------------------------------------------------
@@ -2759,6 +2977,10 @@
2759
  * @since 1.1.7.3
2760
  */
2761
  static function _toggle_debug_mode() {
 
 
 
 
2762
  $is_on = fs_request_get( 'is_on', false, 'post' );
2763
 
2764
  if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
@@ -2790,8 +3012,16 @@
2790
  * @since 1.2.1.7
2791
  */
2792
  static function _get_db_option() {
 
 
2793
  $option_name = fs_request_get( 'option_name' );
2794
 
 
 
 
 
 
 
2795
  $value = get_option( $option_name );
2796
 
2797
  $result = array(
@@ -2814,7 +3044,16 @@
2814
  * @since 1.2.1.7
2815
  */
2816
  static function _set_db_option() {
2817
- $option_name = fs_request_get( 'option_name' );
 
 
 
 
 
 
 
 
 
2818
  $option_value = fs_request_get( 'option_value' );
2819
 
2820
  if ( ! empty( $option_value ) ) {
@@ -2909,6 +3148,10 @@
2909
  }
2910
 
2911
  fs_redirect( $download_url );
 
 
 
 
2912
  }
2913
  }
2914
 
@@ -3263,10 +3506,61 @@
3263
  */
3264
  static function _get_current_wp_user() {
3265
  self::require_pluggable_essentials();
 
3266
 
3267
  return wp_get_current_user();
3268
  }
3269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3270
  /**
3271
  * @author Vova Feldman (@svovaf)
3272
  * @since 2.1.0
@@ -3910,6 +4204,13 @@
3910
 
3911
  $this->parse_settings( $plugin_info );
3912
 
 
 
 
 
 
 
 
3913
  if ( ! self::is_ajax() ) {
3914
  if ( ! $this->is_addon() || $this->is_only_premium() ) {
3915
  add_action(
@@ -3990,14 +4291,16 @@
3990
  * @author Vova Feldman (@svovaf)
3991
  */
3992
  if ( $this->is_user_in_admin() &&
3993
- ! $this->is_addon() &&
3994
- $this->has_addons() &&
3995
- 'plugin-information' === fs_request_get( 'tab', false ) &&
3996
- $this->get_id() == fs_request_get( 'parent_plugin_id', false )
 
 
3997
  ) {
3998
  require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
3999
 
4000
- new FS_Plugin_Info_Dialog( $this );
4001
  }
4002
 
4003
  // Check if Freemius is on for the current plugin.
@@ -4111,7 +4414,21 @@
4111
  * @author Vova Feldman
4112
  * @since 1.2.1.6
4113
  */
4114
- if ( $this->is_premium() && $this->has_release_on_freemius() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4115
  FS_Plugin_Updater::instance( $this );
4116
  }
4117
 
@@ -4154,6 +4471,26 @@
4154
  }
4155
  }
4156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4157
  /**
4158
  * @author Leo Fajardo (@leorw)
4159
  *
@@ -4590,16 +4927,20 @@
4590
  $this->_plugin :
4591
  new FS_Plugin();
4592
 
 
 
4593
  $plugin->update( array(
4594
  'id' => $id,
4595
  'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ),
4596
  'public_key' => $public_key,
4597
  'slug' => $this->_slug,
 
4598
  'parent_plugin_id' => $parent_id,
4599
  'version' => $this->get_plugin_version(),
4600
- 'title' => $this->get_plugin_name(),
4601
  'file' => $this->_plugin_basename,
4602
  'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
 
4603
  'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
4604
  'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
4605
  ) );
@@ -4980,7 +5321,7 @@
4980
  }
4981
 
4982
  $addon = $this->get_addon( $addon_id );
4983
- $premium_basename = "{$addon->slug}-premium/{$addon->slug}.php";
4984
 
4985
  if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) {
4986
  return $premium_basename;
@@ -4988,9 +5329,9 @@
4988
 
4989
  $all_plugins = $this->get_all_plugins();
4990
 
4991
- foreach ( $all_plugins as $basename => &$data ) {
4992
  if ( $addon->slug === $data['slug'] ||
4993
- $addon->slug . '-premium' === $data['slug']
4994
  ) {
4995
  return $basename;
4996
  }
@@ -5230,7 +5571,7 @@
5230
  if ( ! isset( $this->_is_anonymous ) ) {
5231
  if ( $this->is_network_anonymous() ) {
5232
  $this->_is_anonymous = true;
5233
- } else {
5234
  if ( ! isset( $this->_storage->is_anonymous ) ) {
5235
  // Not skipped.
5236
  $this->_is_anonymous = false;
@@ -5421,6 +5762,20 @@
5421
  $this->_storage->store( "{$name}_timestamp", time() );
5422
  }
5423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5424
  /**
5425
  * Check if cron was executed in the last $period of seconds.
5426
  *
@@ -5435,7 +5790,7 @@
5435
  private function is_cron_executed( $name, $period = WP_FS__TIME_24_HOURS_IN_SEC ) {
5436
  $this->_logger->entrance( $name );
5437
 
5438
- $last_execution = $this->set_cron_execution_timestamp( $name );
5439
 
5440
  if ( ! is_numeric( $last_execution ) ) {
5441
  return false;
@@ -5696,12 +6051,14 @@
5696
  }
5697
  }
5698
 
 
 
5699
  foreach ( $users_2_blog_ids as $user_id => $blog_ids ) {
5700
  if ( 0 < $blog_ids[0] ) {
5701
  $this->switch_to_blog( $blog_ids[0] );
5702
  }
5703
 
5704
- call_user_func_array( $callable, array( $blog_ids ) );
5705
 
5706
  foreach ( $blog_ids as $blog_id ) {
5707
  $this->do_action( "after_{$name}_cron", $blog_id );
@@ -5709,6 +6066,8 @@
5709
  }
5710
 
5711
  if ( is_multisite() ) {
 
 
5712
  $this->do_action( "after_{$name}_cron_multisite" );
5713
  }
5714
  }
@@ -5780,13 +6139,16 @@
5780
  * @author Vova Feldman (@svovaf)
5781
  * @since 2.0.0
5782
  *
5783
- * @param int[] $blog_ids
 
 
 
5784
  */
5785
- function _sync_cron_method( array $blog_ids ) {
5786
  if ( $this->is_registered() ) {
5787
  if ( $this->has_paid_plan() ) {
5788
  // Initiate background plan sync.
5789
- $this->_sync_license( true );
5790
 
5791
  if ( $this->is_paying() ) {
5792
  // Check for premium plugin updates.
@@ -5933,7 +6295,7 @@
5933
  * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
5934
  */
5935
  private function schedule_install_sync( $except_blog_id = 0 ) {
5936
- $this->schedule_cron( 'install_sync', 'install_sync', 'single', 0, false, $except_blog_id );
5937
  }
5938
 
5939
  /**
@@ -6001,9 +6363,10 @@
6001
  * @author Vova Feldman (@svovaf)
6002
  * @since 2.0.0
6003
  *
6004
- * @param int[] $blog_ids
 
6005
  */
6006
- function _sync_install_cron_method( array $blog_ids ) {
6007
  if ( $this->is_registered() ) {
6008
  if ( 1 < count( $blog_ids ) ) {
6009
  $this->sync_installs( array(), true );
@@ -6107,6 +6470,7 @@
6107
  if ( ! $this->is_addon() &&
6108
  ! ( ! $this->_is_network_active && fs_is_network_admin() ) &&
6109
  (
 
6110
  // Not registered nor anonymous.
6111
  ( ! $this->is_registered() && ! $this->is_anonymous() ) ||
6112
  // OR, network level and in network upgrade mode.
@@ -6123,14 +6487,18 @@
6123
  * @since 1.2.2
6124
  */
6125
  if ( $this->is_theme()
6126
- && $this->is_only_premium()
6127
  && ! $this->has_settings_menu()
6128
  && ! isset( $_REQUEST['fs_action'] )
6129
  && $this->can_activate_previous_theme()
6130
  ) {
6131
- $this->activate_previous_theme();
 
 
 
6132
 
6133
- return;
 
 
6134
  }
6135
 
6136
  if ( ! fs_is_network_admin() &&
@@ -6141,19 +6509,21 @@
6141
  }
6142
 
6143
  if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
6144
- // Show notice for new plugin installations.
6145
- $this->_admin_notices->add(
6146
- sprintf(
6147
- $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
6148
- sprintf( '<b><a href="%s">%s</a></b>',
6149
- $this->get_activation_url( array(), ! $this->is_delegated_connection() ),
6150
- sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
6151
- '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
6152
- )
6153
- ),
6154
- '',
6155
- 'update-nag'
6156
- );
 
 
6157
  } else {
6158
  if ( $this->should_add_sticky_optin_notice() ) {
6159
  $this->add_sticky_optin_admin_notice();
@@ -6228,7 +6598,7 @@
6228
  $this->_module_type,
6229
  sprintf( '<b><a href="%s">%s</a></b>',
6230
  $this->get_activation_url(),
6231
- sprintf( $this->get_text_inline( 'Opt in to make "%s" Better!', 'optin-x-now' ), $this->get_plugin_name() )
6232
  )
6233
  ),
6234
  'connect_account',
@@ -6690,6 +7060,20 @@
6690
  }
6691
  }
6692
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6693
  if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
6694
  /**
6695
  * If no previous version of plugin's version exist, it means that it's either
@@ -6959,7 +7343,7 @@
6959
  private function remove_sdk_reference() {
6960
  global $fs_active_plugins;
6961
 
6962
- foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
6963
  if ( $this->_plugin_basename == $data->plugin_path ) {
6964
  unset( $fs_active_plugins->plugins[ $sdk_path ] );
6965
  break;
@@ -7141,6 +7525,23 @@
7141
  }
7142
  }
7143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7144
  /**
7145
  * Clears the anonymous mode and redirects to the opt-in screen.
7146
  *
@@ -7154,6 +7555,8 @@
7154
 
7155
  $this->reset_anonymous_mode( fs_is_network_admin() );
7156
 
 
 
7157
  fs_redirect( $this->get_activation_url() );
7158
  }
7159
 
@@ -7593,39 +7996,43 @@
7593
  $include_plugins = true,
7594
  $include_themes = true
7595
  ) {
7596
- /**
7597
- * @since 1.1.8 Also send plugin updates.
7598
- */
7599
- if ( $include_plugins && ! isset( $override['plugins'] ) ) {
7600
- $plugins = $this->get_plugins_data_for_api();
7601
- if ( ! empty( $plugins ) ) {
7602
- $override['plugins'] = $plugins;
 
 
7603
  }
7604
  }
7605
- /**
7606
- * @since 1.1.8 Also send themes updates.
7607
- */
7608
- if ( $include_themes && ! isset( $override['themes'] ) ) {
7609
- $themes = $this->get_themes_data_for_api();
7610
- if ( ! empty( $themes ) ) {
7611
- $override['themes'] = $themes;
 
 
 
7612
  }
7613
  }
7614
 
7615
- return array_merge( array(
7616
- 'version' => $this->get_plugin_version(),
7617
- 'is_premium' => $this->is_premium(),
7618
- 'language' => get_bloginfo( 'language' ),
7619
- 'charset' => get_bloginfo( 'charset' ),
7620
- 'platform_version' => get_bloginfo( 'version' ),
7621
- 'sdk_version' => $this->version,
7622
- 'programming_language_version' => phpversion(),
7623
- 'title' => get_bloginfo( 'name' ),
7624
- 'url' => get_site_url(),
7625
  // Special params.
7626
- 'is_active' => true,
7627
- 'is_disconnected' => $this->is_tracking_prohibited(),
7628
- 'is_uninstalled' => false,
7629
  ), $override );
7630
  }
7631
 
@@ -7670,12 +8077,10 @@
7670
  // }
7671
 
7672
  // Common properties.
7673
- $common = array_merge( array(
7674
- 'version' => $this->get_plugin_version(),
7675
- 'is_premium' => $this->is_premium(),
7676
- 'sdk_version' => $this->version,
7677
- 'programming_language_version' => phpversion(),
7678
- 'platform_version' => get_bloginfo( 'version' ),
7679
  ), $override );
7680
 
7681
 
@@ -7829,28 +8234,56 @@
7829
  $params = $this->get_install_diff_for_api( $check_properties, $this->_site, $override );
7830
  }
7831
 
7832
- if ( 0 < count( $params ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7833
  if ( ! is_multisite() ) {
7834
  // Update last install sync timestamp.
7835
  $this->set_cron_execution_timestamp( 'install_sync' );
7836
  }
7837
 
7838
  $params['uid'] = $this->get_anonymous_id();
 
7839
 
7840
- // Send updated values to FS.
7841
- $site = $this->get_api_site_scope()->call( '/', 'put', $params );
7842
 
7843
- if ( $this->is_api_result_entity( $site ) ) {
7844
- if ( ! is_multisite() ) {
7845
- // I successfully sent install update, clear scheduled sync if exist.
7846
- $this->clear_install_sync_cron();
7847
- }
7848
- }
7849
 
7850
- return $site;
 
 
 
 
 
 
 
 
 
 
7851
  }
7852
 
7853
- return false;
7854
  }
7855
 
7856
  /**
@@ -7869,24 +8302,70 @@
7869
 
7870
  $installs_data = $this->get_installs_data_for_api( $override, ! $flush );
7871
 
 
7872
  if ( empty( $installs_data ) ) {
7873
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7874
  }
7875
 
7876
- // Update last install sync timestamp.
7877
- $this->set_cron_execution_timestamp( 'install_sync' );
 
 
 
 
 
 
 
 
 
 
7878
 
7879
  // Send updated values to FS.
7880
  $result = $this->get_api_user_scope()->call( "/plugins/{$this->_plugin->id}/installs.json", 'put', $installs_data );
7881
 
7882
- if ( $this->is_api_result_object( $result, 'installs' ) ) {
7883
- // I successfully sent installs update, clear scheduled sync if exist.
7884
  $this->clear_install_sync_cron();
7885
  }
7886
 
7887
  return $result;
7888
  }
7889
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7890
  /**
7891
  * Update install only if changed.
7892
  *
@@ -8091,14 +8570,59 @@
8091
  // @todo Decide if we want to delete plugin information from db.
8092
  }
8093
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8094
  /**
8095
  * @author Vova Feldman (@svovaf)
8096
  * @since 1.1.1
 
8097
  *
8098
  * @return string
8099
  */
8100
  function premium_plugin_basename() {
8101
- return "{$this->_slug}-premium/" . basename( $this->_free_plugin_basename );
 
 
 
 
 
 
 
8102
  }
8103
 
8104
  /**
@@ -8237,13 +8761,29 @@
8237
  }
8238
 
8239
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8240
  * @author Vova Feldman (@svovaf)
8241
  * @since 1.2.1.7
8242
  *
8243
  * @return string Plugin slug.
8244
  */
8245
  function get_target_folder_name() {
8246
- return $this->_slug . ( $this->can_use_premium_code() ? '-premium' : '' );
 
 
8247
  }
8248
 
8249
  /**
@@ -8314,31 +8854,63 @@
8314
  * @author Vova Feldman (@svovaf)
8315
  * @since 1.0.9
8316
  *
 
 
8317
  * @return string
8318
  */
8319
- function get_plugin_name() {
8320
  $this->_logger->entrance();
8321
 
 
 
 
 
 
8322
  if ( ! isset( $this->_plugin_name ) ) {
8323
- $plugin_data = $this->get_plugin_data();
 
 
 
 
 
 
 
 
8324
 
8325
- // Get name.
8326
- $this->_plugin_name = $plugin_data['Name'];
8327
 
8328
- // Check if plugin name contains "(Premium)" suffix and remove it.
8329
- $suffix = ' (premium)';
8330
- $suffix_len = strlen( $suffix );
 
 
 
 
 
 
 
8331
 
8332
- if ( strlen( $plugin_data['Name'] ) > $suffix_len &&
8333
- $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len )
8334
- ) {
8335
- $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len );
8336
- }
8337
 
8338
- $this->_logger->departure( 'Name = ' . $this->_plugin_name );
 
 
 
 
 
 
 
 
 
 
8339
  }
8340
 
8341
- return $this->_plugin_name;
8342
  }
8343
 
8344
  /**
@@ -9044,7 +9616,16 @@
9044
  * @return bool
9045
  */
9046
  function is_premium() {
9047
- return $this->_plugin->is_premium;
 
 
 
 
 
 
 
 
 
9048
  }
9049
 
9050
  /**
@@ -10434,6 +11015,56 @@
10434
  fs_require_template( 'forms/resend-key.php', $vars );
10435
  }
10436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10437
  /**
10438
  * @author Leo Fajardo (@leorw)
10439
  * @since 2.0.2
@@ -10518,7 +11149,7 @@
10518
  return;
10519
  }
10520
 
10521
- if ( ! $this->is_premium() || $this->has_active_valid_license() ) {
10522
  // This is relevant only to the free versions and premium versions without an active license.
10523
  return;
10524
  }
@@ -10618,7 +11249,7 @@
10618
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
10619
  );
10620
 
10621
- $install = $api->call( '/', 'put', $params );
10622
 
10623
  if ( FS_Api::is_api_error( $install ) ) {
10624
  $error = FS_Api::is_api_error_object( $install ) ?
@@ -10711,6 +11342,10 @@
10711
  }
10712
  }
10713
 
 
 
 
 
10714
  $result = array(
10715
  'success' => ( false === $error )
10716
  );
@@ -10805,7 +11440,7 @@
10805
  $next_page = $this->get_after_activation_url( 'after_network_activation_url' );
10806
  }
10807
  } else {
10808
- $error = $this->get_text_inline( 'invalid_site_details_collection', 'Invalid site details collection.' );
10809
  }
10810
 
10811
  $result = array(
@@ -10965,6 +11600,34 @@
10965
  static function get_current_page() {
10966
  if ( ! isset( self::$_pagenow ) ) {
10967
  global $pagenow;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10968
 
10969
  self::$_pagenow = $pagenow;
10970
 
@@ -10996,6 +11659,16 @@
10996
  return ( 'plugins.php' === self::get_current_page() );
10997
  }
10998
 
 
 
 
 
 
 
 
 
 
 
10999
  /**
11000
  * @author Leo Fajardo (@leorw)
11001
  * @since 2.0.2
@@ -11263,6 +11936,40 @@
11263
  return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true );
11264
  }
11265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11266
  /**
11267
  * Plugin's pricing URL.
11268
  *
@@ -11897,7 +12604,13 @@
11897
  * @author Vova Feldman (@svovaf)
11898
  */
11899
  $args = array(
11900
- 'public' => 1,
 
 
 
 
 
 
11901
  'archived' => 0,
11902
  'mature' => 0,
11903
  'spam' => 0,
@@ -12093,7 +12806,7 @@
12093
 
12094
  self::$_accounts->set_site_blog_context( $blog_id );
12095
  $this->_storage->set_site_blog_context( $blog_id );
12096
- $this->_storage->set_network_active( true, $this->is_delegated_connection( $blog_id ) );
12097
 
12098
  $this->_site = is_object( $install ) ?
12099
  $install :
@@ -13042,6 +13755,12 @@
13042
  }
13043
  }
13044
 
 
 
 
 
 
 
13045
  if ( $this->is_theme() ) {
13046
  $this->_register_account_hooks();
13047
  }
@@ -13092,19 +13811,43 @@
13092
  * @param FS_Site $site
13093
  * @param bool|array $plans
13094
  */
13095
- private function _set_account( FS_User $user, FS_Site $site, $plans = false ) {
13096
- $site->user_id = $user->id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13097
 
13098
- $this->_site = $site;
13099
- $this->_user = $user;
13100
- if ( false !== $plans ) {
13101
- $this->_plans = $plans;
13102
  }
13103
 
13104
- $this->send_install_update();
13105
-
13106
- $this->_store_account();
13107
-
13108
  }
13109
 
13110
  /**
@@ -13128,7 +13871,9 @@
13128
  // Return to the module's main page.
13129
  $this->get_after_activation_url( 'after_connect_url', array( 'fs_action' => $activation_action ) );
13130
 
13131
- $params = array(
 
 
13132
  'user_firstname' => $current_user->user_firstname,
13133
  'user_lastname' => $current_user->user_lastname,
13134
  'user_nickname' => $current_user->user_nicename,
@@ -13143,13 +13888,10 @@
13143
  'account',
13144
  array( 'fs_action' => 'sync_user' )
13145
  ), 'sync_user' ),
13146
- 'platform_version' => get_bloginfo( 'version' ),
13147
- 'sdk_version' => $this->version,
13148
- 'programming_language_version' => phpversion(),
13149
  'is_premium' => $this->is_premium(),
13150
  'is_active' => true,
13151
  'is_uninstalled' => false,
13152
- );
13153
 
13154
  if ( true === $network_level_or_blog_id ) {
13155
  if ( ! isset( $override_with['sites'] ) ) {
@@ -13335,7 +14077,7 @@
13335
  'timeout' => WP_FS__DEBUG_SDK ? 60 : 30,
13336
  );
13337
 
13338
- $url = WP_FS__ADDRESS . '/action/service/user/install/';
13339
  $response = self::safe_remote_post( $url, $request );
13340
 
13341
  if ( is_wp_error( $response ) ) {
@@ -14331,16 +15073,17 @@
14331
  unset( $parent_fs->_storage->is_pending_activation );
14332
  }
14333
 
 
 
 
14334
  // First of all, set site info - otherwise we won't
14335
  // be able to invoke API calls.
14336
  $parent_fs->_site = new FS_Site( $parent_install );
 
14337
 
14338
  // Sync add-on plans.
14339
  $parent_fs->_sync_plans();
14340
 
14341
- // Get user information based on parent's plugin.
14342
- $user = $this->get_user();
14343
-
14344
  $parent_fs->_set_account( $user, $parent_fs->_site );
14345
  }
14346
 
@@ -14491,7 +15234,7 @@
14491
 
14492
  $hook = false;
14493
 
14494
- if ( ! $this->_menu->has_menu() ) {
14495
  // Add the opt-in page without a menu item.
14496
  $hook = FS_Admin_Menu_Manager::add_subpage(
14497
  null,
@@ -14704,13 +15447,15 @@
14704
  private function add_submenu_items() {
14705
  $this->_logger->entrance();
14706
 
 
 
14707
  if ( $this->is_addon() ) {
14708
  // No submenu items for add-ons.
14709
  $add_submenu_items = false;
14710
  } else if ( $this->is_free_wp_org_theme() && ! fs_is_network_admin() ) {
14711
  // Also add submenu items when running in a free .org theme so the tabs will be visible.
14712
  $add_submenu_items = true;
14713
- } else if ( $this->is_activation_mode() && ! $this->is_free_wp_org_theme() ) {
14714
  $add_submenu_items = false;
14715
  } else if ( fs_is_network_admin() ) {
14716
  /**
@@ -14741,7 +15486,15 @@
14741
  $this->is_submenu_item_visible( 'affiliation' )
14742
  );
14743
  }
 
14744
 
 
 
 
 
 
 
 
14745
  if ( ! WP_FS__DEMO_MODE && $this->is_registered() ) {
14746
  $show_account = (
14747
  $this->is_submenu_item_visible( 'account' ) &&
@@ -14760,10 +15513,12 @@
14760
  'account',
14761
  array( &$this, '_account_page_load' ),
14762
  WP_FS__DEFAULT_PRIORITY,
14763
- $show_account
14764
  );
14765
  }
 
14766
 
 
14767
  // Add contact page.
14768
  $this->add_submenu_item(
14769
  $this->get_text_inline( 'Contact Us', 'contact-us' ),
@@ -14788,7 +15543,11 @@
14788
  $this->is_submenu_item_visible( 'addons' )
14789
  );
14790
  }
 
14791
 
 
 
 
14792
  if ( ! WP_FS__DEMO_MODE ) {
14793
  $show_pricing = (
14794
  $this->is_submenu_item_visible( 'pricing' ) &&
@@ -14810,28 +15569,38 @@
14810
 
14811
  // Add upgrade/pricing page.
14812
  $this->add_submenu_item(
14813
- $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' ),
14814
  array( &$this, '_pricing_page_render' ),
14815
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
14816
  'manage_options',
14817
  'pricing',
14818
  'Freemius::_clean_admin_content_section',
14819
  WP_FS__LOWEST_PRIORITY,
14820
- $show_pricing,
14821
  $pricing_class
14822
  );
14823
  }
14824
  }
14825
 
14826
- if ( 0 < count( $this->_menu_items ) ) {
14827
- if ( ! $this->_menu->is_top_level() ) {
14828
- fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
 
 
 
 
 
 
 
 
 
14829
 
14830
- // Append submenu items right after the plugin's submenu item.
14831
- $this->order_sub_submenu_items();
14832
- } else {
14833
- // Append submenu items.
14834
- $this->embed_submenu_items();
 
14835
  }
14836
  }
14837
  }
@@ -14857,16 +15626,6 @@
14857
 
14858
  foreach ( $this->_menu_items as $priority => $items ) {
14859
  foreach ( $items as $item ) {
14860
- if ( $item['show_submenu'] && $is_first_submenu_item ) {
14861
- if ( $this->_is_network_active && ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
14862
- $item['menu_slug'] = '';
14863
-
14864
- $this->_menu->override_menu_item( $item['render_function'] );
14865
- }
14866
-
14867
- $is_first_submenu_item = false;
14868
- }
14869
-
14870
  $capability = ( ! empty( $item['capability'] ) ? $item['capability'] : $top_level_menu_capability );
14871
 
14872
  $menu_item = sprintf(
@@ -14877,12 +15636,13 @@
14877
  $item['menu_title']
14878
  );
14879
 
14880
- $menu_slug = $this->_menu->get_slug( $item['menu_slug'] );
 
14881
 
14882
  if ( ! isset( $item['url'] ) ) {
14883
  $hook = FS_Admin_Menu_Manager::add_subpage(
14884
  $item['show_submenu'] ?
14885
- $this->get_top_level_menu_slug() :
14886
  null,
14887
  $item['page_title'],
14888
  $menu_item,
@@ -14897,7 +15657,7 @@
14897
  } else {
14898
  FS_Admin_Menu_Manager::add_subpage(
14899
  $item['show_submenu'] ?
14900
- $this->get_top_level_menu_slug() :
14901
  null,
14902
  $item['page_title'],
14903
  $menu_item,
@@ -14906,6 +15666,24 @@
14906
  array( $this, '' )
14907
  );
14908
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14909
  }
14910
  }
14911
  }
@@ -15517,7 +16295,8 @@
15517
  return;
15518
  }
15519
 
15520
- $encrypted_site = clone ( is_object( $site ) ? $site : $this->_site );
 
15521
 
15522
  $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
15523
 
@@ -15885,7 +16664,7 @@
15885
  /**
15886
  * @since 1.2.3 When running in DEV mode, retrieve pending plans as well.
15887
  */
15888
- $result = $api->get( "/plugins/{$this->_module_id}/plans.json?show_pending=" . ( $this->has_secret_key() ? 'true' : 'false' ), true );
15889
 
15890
  if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) {
15891
  for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) {
@@ -16147,11 +16926,12 @@
16147
  * @param bool|number $plugin_id
16148
  * @param bool $flush Since 1.1.7.3
16149
  * @param int $expiration Since 1.2.2.7
 
16150
  *
16151
  * @return object|false New plugin tag info if exist.
16152
  */
16153
- private function _fetch_newer_version( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
16154
- $latest_tag = $this->_fetch_latest_version( $plugin_id, $flush, $expiration );
16155
 
16156
  if ( ! is_object( $latest_tag ) ) {
16157
  return false;
@@ -16176,17 +16956,18 @@
16176
  * @param bool|number $plugin_id
16177
  * @param bool $flush Since 1.1.7.3
16178
  * @param int $expiration Since 1.2.2.7
 
16179
  *
16180
  * @return bool|FS_Plugin_Tag
16181
  */
16182
- function get_update( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
16183
  $this->_logger->entrance();
16184
 
16185
  if ( ! is_numeric( $plugin_id ) ) {
16186
  $plugin_id = $this->_plugin->id;
16187
  }
16188
 
16189
- $this->check_updates( true, $plugin_id, $flush, $expiration );
16190
  $updates = $this->get_all_updates();
16191
 
16192
  return isset( $updates[ $plugin_id ] ) && is_object( $updates[ $plugin_id ] ) ? $updates[ $plugin_id ] : false;
@@ -16215,14 +16996,62 @@
16215
  * @since 1.2.1
16216
  */
16217
  function has_active_valid_license() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16218
  return (
16219
- is_object( $this->_license ) &&
16220
- is_numeric( $this->_license->id ) &&
16221
- $this->_license->is_active() &&
16222
- $this->_license->is_valid()
16223
  );
16224
  }
16225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16226
  /**
16227
  * Check if site assigned with license with enabled features.
16228
  *
@@ -16291,8 +17120,11 @@
16291
  * the admin.
16292
  * @param bool $is_context_single_site @since 2.0.0. This is used when syncing a license for a single install from the
16293
  * network-level "Account" page.
 
 
 
16294
  */
16295
- private function _sync_license( $background = false, $is_context_single_site = false ) {
16296
  $this->_logger->entrance();
16297
 
16298
  $plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
@@ -16302,7 +17134,7 @@
16302
  if ( $is_addon_sync ) {
16303
  $this->_sync_addon_license( $plugin_id, $background );
16304
  } else {
16305
- $this->_sync_plugin_license( $background, true, $is_context_single_site );
16306
  }
16307
 
16308
  $this->do_action( 'after_account_plan_sync', $this->get_plan_name() );
@@ -16353,7 +17185,7 @@
16353
  $this->_update_licenses( $licenses, $addon->id );
16354
 
16355
  if ( ! $this->is_addon_installed( $addon->id ) && FS_License_Manager::has_premium_license( $licenses ) ) {
16356
- $plans_result = $this->get_api_site_or_plugin_scope()->get( "/addons/{$addon_id}/plans.json" );
16357
 
16358
  if ( ! isset( $plans_result->error ) ) {
16359
  $plans = array();
@@ -16392,11 +17224,15 @@
16392
  * @param bool $is_context_single_site Since 2.0.0. This is used when sending an update for a single install and
16393
  * syncing its license from the network-level "Account" page (e.g.: after
16394
  * activating a license only for the single install).
 
 
 
16395
  */
16396
  private function _sync_plugin_license(
16397
  $background = false,
16398
  $send_installs_update = true,
16399
- $is_context_single_site = false
 
16400
  ) {
16401
  $this->_logger->entrance();
16402
 
@@ -16413,6 +17249,16 @@
16413
  * @todo This line will execute install sync on a daily basis, even if running the free version (for opted-in users). The reason we want to keep it that way is for cases when the user was a paying customer, then there was a failure in subscription payment, and then after some time the payment was successful. This could be heavily optimized. For example, we can skip the $flush if the current install was never associated with a paid version.
16414
  */
16415
  if ( $is_site_level_sync ) {
 
 
 
 
 
 
 
 
 
 
16416
  $result = $this->send_install_update( array(), true );
16417
  $is_valid = $this->is_api_result_entity( $result );
16418
  } else {
@@ -16681,6 +17527,7 @@
16681
  'trial_promotion',
16682
  'trial_expired',
16683
  'activation_complete',
 
16684
  ) );
16685
  break;
16686
  case 'changed':
@@ -16921,6 +17768,18 @@
16921
  $api = $this->get_api_site_scope();
16922
  $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' );
16923
 
 
 
 
 
 
 
 
 
 
 
 
 
16924
  if ( isset( $license->error ) ) {
16925
  $this->_admin_notices->add(
16926
  $this->get_text_inline( 'It looks like the license deactivation failed.', 'license-deactivation-failed-message' ) . '<br> ' .
@@ -16941,7 +17800,7 @@
16941
  }
16942
  }
16943
 
16944
- // Updated site plan to default.
16945
  $this->_sync_plans();
16946
  $this->_site->plan_id = $this->_plans[0]->id;
16947
  // Unlink license from site.
@@ -16968,13 +17827,17 @@
16968
  * @author Vova Feldman (@svovaf)
16969
  * @since 1.0.4
16970
  *
 
 
16971
  * @uses FS_Api
16972
  */
16973
  private function _downgrade_site() {
16974
  $this->_logger->entrance();
16975
 
 
 
16976
  $api = $this->get_api_site_scope();
16977
- $site = $api->call( 'downgrade.json', 'put' );
16978
 
16979
  $plan_downgraded = false;
16980
  $plan = false;
@@ -16992,29 +17855,47 @@
16992
  ( is_object( $subscription ) && ! isset( $subscription->error ) && ! $subscription->is_active() );
16993
  } else {
16994
  // handle different error cases.
16995
-
 
 
 
16996
  }
16997
 
16998
- if ( $plan_downgraded ) {
16999
- // Remove previous sticky message about upgrade (if exist).
17000
- $this->_admin_notices->remove_sticky( 'plan_upgraded' );
17001
-
17002
- $this->_admin_notices->add(
17003
- sprintf( $this->get_text_inline( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.', 'plan-x-downgraded-message' ),
17004
- $plan->title,
17005
- human_time_diff( time(), strtotime( $this->_license->expiration ) )
17006
  )
17007
  );
 
17008
 
17009
- // Store site updates.
17010
- $this->_store_site();
17011
- } else {
17012
- $this->_admin_notices->add(
17013
- $this->get_text_inline( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.', 'plan-downgraded-failure-message' ),
17014
- $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
17015
- 'error'
17016
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17017
  }
 
 
17018
  }
17019
 
17020
  /**
@@ -17121,22 +18002,19 @@
17121
  * @author Vova Feldman (@svovaf)
17122
  * @since 1.0.9
17123
  *
 
 
17124
  * @uses FS_Api
17125
  */
17126
  private function _cancel_trial() {
17127
  $this->_logger->entrance();
17128
 
17129
- // Alias.
17130
- $oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...';
17131
-
17132
  if ( ! $this->is_trial() ) {
17133
- $this->_admin_notices->add(
17134
- $this->get_text_inline( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'trial-cancel-no-trial-message' ),
17135
- $oops_text,
17136
- 'error'
17137
  );
17138
-
17139
- return;
17140
  }
17141
 
17142
  $trial_plan = $this->get_trial_plan();
@@ -17167,31 +18045,33 @@
17167
  // @todo handle different error cases.
17168
  }
17169
 
17170
- if ( $trial_cancelled ) {
17171
- // Remove previous sticky messages about upgrade or trial (if exist).
17172
- $this->_admin_notices->remove_sticky( array(
17173
- 'trial_started',
17174
- 'trial_promotion',
17175
- 'plan_upgraded',
17176
- ) );
17177
 
17178
- // Store site updates.
17179
- $this->_store_site();
 
 
 
 
17180
 
17181
- if ( ! $this->is_addon() ||
17182
- ! $this->deactivate_premium_only_addon_without_license( true )
17183
- ) {
17184
- $this->_admin_notices->add(
17185
- sprintf( $this->get_text_inline( 'Your %s free trial was successfully cancelled.', 'trial-cancel-message' ), $trial_plan->title )
17186
- );
17187
- }
17188
- } else {
17189
  $this->_admin_notices->add(
17190
- $this->get_text_inline( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'trial-cancel-failure-message' ),
17191
- $oops_text,
17192
- 'error'
17193
  );
17194
  }
 
 
17195
  }
17196
 
17197
  /**
@@ -17215,7 +18095,7 @@
17215
  * @return bool
17216
  */
17217
  private function _can_download_premium() {
17218
- return $this->has_active_valid_license() ||
17219
  ( $this->is_trial() && ! $this->get_trial_plan()->is_free() );
17220
  }
17221
 
@@ -17235,9 +18115,10 @@
17235
 
17236
  $is_premium = null;
17237
  if ( ! $is_addon ) {
17238
- $is_premium = $this->is_premium();
17239
  } else if ( $this->is_addon_activated( $addon_id ) ) {
17240
- $is_premium = self::get_instance_by_id( $addon_id )->is_premium();
 
17241
  }
17242
 
17243
  // If add-on, then append add-on ID.
@@ -17261,15 +18142,19 @@
17261
  * @since 1.0.4
17262
  *
17263
  * @param bool|number $addon_id
17264
- * @param bool $flush Since 1.1.7.3
17265
- * @param int $expiration Since 1.2.2.7
 
 
17266
  *
17267
  * @return object|false Plugin latest tag info.
17268
  */
17269
  function _fetch_latest_version(
17270
  $addon_id = false,
17271
  $flush = true,
17272
- $expiration = WP_FS__TIME_24_HOURS_IN_SEC
 
 
17273
  ) {
17274
  $this->_logger->entrance();
17275
 
@@ -17320,8 +18205,18 @@
17320
  $this->switch_to_blog( $switch_to_blog_id );
17321
  }
17322
 
 
 
 
 
 
 
 
 
 
 
17323
  $tag = $this->get_api_site_or_plugin_scope()->get(
17324
- $this->_get_latest_version_endpoint( $addon_id, 'json' ),
17325
  $flush,
17326
  $expiration
17327
  );
@@ -17433,9 +18328,15 @@
17433
 
17434
  if ( ! empty( $plugin_id ) ) {
17435
  $params['plugin_id'] = $plugin_id;
 
 
17436
  }
17437
 
17438
- return $this->get_account_url( 'download_latest', $params );
 
 
 
 
17439
  }
17440
 
17441
  #endregion Download Plugin ------------------------------------------------------------------
@@ -17451,17 +18352,19 @@
17451
  * @param bool|number $plugin_id
17452
  * @param bool $flush Since 1.1.7.3
17453
  * @param int $expiration Since 1.2.2.7
 
17454
  */
17455
  private function check_updates(
17456
  $background = false,
17457
  $plugin_id = false,
17458
  $flush = true,
17459
- $expiration = WP_FS__TIME_24_HOURS_IN_SEC
 
17460
  ) {
17461
  $this->_logger->entrance();
17462
 
17463
  // Check if there's a newer version for download.
17464
- $new_version = $this->_fetch_newer_version( $plugin_id, $flush, $expiration );
17465
 
17466
  $update = null;
17467
  if ( is_object( $new_version ) ) {
@@ -17511,19 +18414,21 @@
17511
 
17512
  $api = $this->get_api_site_or_plugin_scope();
17513
 
 
 
17514
  /**
17515
  * @since 1.2.1
17516
  *
17517
  * If there's a cached version of the add-ons and not asking
17518
  * for a flush, just use the currently stored add-ons.
17519
  */
17520
- if ( ! $flush && $api->is_cached( '/addons.json?enriched=true' ) ) {
17521
  $addons = self::get_all_addons();
17522
 
17523
  return $addons[ $this->_plugin->id ];
17524
  }
17525
 
17526
- $result = $api->get( '/addons.json?enriched=true', $flush );
17527
 
17528
  $addons = array();
17529
  if ( $this->is_api_result_object( $result, 'plugins' ) &&
@@ -17815,7 +18720,9 @@
17815
  */
17816
  function get_after_activation_url( $filter, $params = array(), $network = null ) {
17817
  if ( $this->is_free_wp_org_theme() &&
17818
- fs_request_has( 'pending_activation' )
 
 
17819
  ) {
17820
  $first_time_path = '';
17821
  } else {
@@ -17947,6 +18854,8 @@
17947
  $this->_site = null;
17948
  $this->_user = null;
17949
 
 
 
17950
  fs_redirect( $this->get_activation_url() );
17951
  } else {
17952
  if ( $this->is_addon_activated( $plugin_id ) ) {
@@ -17966,15 +18875,23 @@
17966
  check_admin_referer( $action );
17967
  }
17968
 
17969
- if ( $plugin_id == $this->get_id() ) {
17970
- $this->_downgrade_site();
 
 
 
17971
 
17972
- if ( is_numeric( $blog_id ) ) {
17973
- $this->switch_to_blog( $this->_storage->network_install_blog_id );
17974
- }
17975
- } else if ( $this->is_addon_activated( $plugin_id ) ) {
17976
- $fs_addon = self::get_instance_by_id( $plugin_id );
17977
- $fs_addon->_downgrade_site();
 
 
 
 
 
17978
  }
17979
 
17980
  return;
@@ -18006,7 +18923,11 @@
18006
  $this->_site = null;
18007
  $this->_user = null;
18008
 
18009
- fs_redirect( $this->get_activation_url() );
 
 
 
 
18010
  }
18011
  } else {
18012
  if ( $this->is_addon_activated( $plugin_id ) ) {
@@ -18104,13 +19025,13 @@
18104
  #region Actions that might be called from external links (e.g. email)
18105
 
18106
  case 'cancel_trial':
18107
- if ( $plugin_id == $this->get_id() ) {
18108
- $this->_cancel_trial();
18109
- } else {
18110
- if ( $this->is_addon_activated( $plugin_id ) ) {
18111
- $fs_addon = self::get_instance_by_id( $plugin_id );
18112
- $fs_addon->_cancel_trial();
18113
- }
18114
  }
18115
 
18116
  return;
@@ -18339,9 +19260,9 @@
18339
  $vars = array( 'id' => $this->_module_id );
18340
 
18341
  if ( 'true' === fs_request_get( 'checkout', false ) ) {
18342
- fs_require_once_template( 'checkout.php', $vars );
18343
  } else {
18344
- fs_require_once_template( 'pricing.php', $vars );
18345
  }
18346
  }
18347
 
@@ -18359,7 +19280,15 @@
18359
  $this->_logger->entrance();
18360
 
18361
  $vars = array( 'id' => $this->_module_id );
18362
- fs_require_once_template( 'contact.php', $vars );
 
 
 
 
 
 
 
 
18363
  }
18364
 
18365
  #endregion ------------------------------------------------------------------------
@@ -18456,7 +19385,9 @@
18456
  * @return FS_Api
18457
  */
18458
  private function get_current_or_network_user_api_scope( $flush = false ) {
18459
- if ( ! $this->_is_network_active || isset( $this->_user ) ) {
 
 
18460
  return $this->get_api_user_scope( $flush );
18461
  }
18462
 
@@ -18544,9 +19475,19 @@
18544
  * @author Vova Feldman (@svovaf)
18545
  * @since 1.0.9
18546
  *
18547
- * @param $plans
18548
  */
18549
  function _check_for_trial_plans( $plans ) {
 
 
 
 
 
 
 
 
 
 
18550
  $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan( $plans );
18551
  }
18552
 
@@ -18653,14 +19594,14 @@
18653
 
18654
  // Show promotion if never shown before and 24 hours after initial activation with FS.
18655
  if ( ! $was_promotion_shown_before &&
18656
- $this->_storage->install_timestamp > ( time() - WP_FS__TIME_24_HOURS_IN_SEC )
18657
  ) {
18658
  return false;
18659
  }
18660
 
18661
  // OR if promotion was shown before, try showing it every 30 days.
18662
  if ( $was_promotion_shown_before &&
18663
- 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_trial_promotion_shown
18664
  ) {
18665
  return false;
18666
  }
@@ -19086,11 +20027,23 @@
19086
 
19087
  if ( ! $this->is_addon() || ! $this->has_free_plan() ) {
19088
  $first_time_path = $this->_menu->get_first_time_path();
19089
- $url = $this->is_activation_mode() ?
19090
- $this->get_activation_url() :
19091
- ( empty( $first_time_path ) ?
19092
- $this->_get_admin_page_url() :
19093
- $first_time_path );
 
 
 
 
 
 
 
 
 
 
 
 
19094
  } else {
19095
  $plugin_fs = false;
19096
 
@@ -19210,6 +20163,21 @@
19210
  $this->_admin_notices->add_sticky( $message, $id, $title, $type );
19211
  }
19212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19213
  /**
19214
  * Helper function that returns the final steps for the upgrade completion.
19215
  *
@@ -19235,25 +20203,52 @@
19235
  $plan_title = $this->get_plan_title();
19236
  }
19237
 
19238
- // @since 1.2.1.5 The free version is auto deactivated.
19239
- $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
19240
- ( '<li>' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.</li>' ) :
19241
- '';
 
 
 
 
 
19242
 
19243
- return sprintf(
19244
- ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
19245
- $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
19246
- ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
19247
- $this->get_latest_download_link( sprintf(
19248
- /* translators: %s: Plan title */
19249
- $this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ),
19250
- $plan_title
19251
- ) ),
19252
- $deactivation_step,
19253
- $this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ),
19254
- '//bit.ly/upload-wp-' . $this->_module_type . 's',
19255
- $this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' )
19256
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19257
  }
19258
 
19259
  /**
@@ -19285,14 +20280,16 @@
19285
  * @param array $request
19286
  * @param int $success_cache_expiration
19287
  * @param int $failure_cache_expiration
 
19288
  *
19289
  * @return WP_Error|array
19290
  */
19291
- private static function safe_remote_post(
19292
  &$url,
19293
  $request,
19294
  $success_cache_expiration = 0,
19295
- $failure_cache_expiration = 0
 
19296
  ) {
19297
  $should_cache = ($success_cache_expiration + $failure_cache_expiration > 0);
19298
 
@@ -19303,7 +20300,9 @@
19303
  false;
19304
 
19305
  if ( false === $response ) {
19306
- self::enrich_request_for_debug( $url, $request );
 
 
19307
 
19308
  $response = wp_remote_post( $url, $request );
19309
 
@@ -20032,13 +21031,19 @@
20032
 
20033
  // Locate the main assets folder.
20034
  if ( 1 < count( $fs_active_plugins->plugins ) ) {
20035
- $plugin_or_theme_img_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root() );
20036
 
20037
  foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
20038
  if ( $data->plugin_path == $this->get_plugin_basename() ) {
20039
  $img_dir = $plugin_or_theme_img_dir
20040
  . '/'
20041
- . str_replace( '../themes/', '', $sdk_path )
 
 
 
 
 
 
20042
  . '/assets/img';
20043
 
20044
  break;
@@ -20058,6 +21063,10 @@
20058
  $icon_found = false;
20059
  $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" );
20060
 
 
 
 
 
20061
  $have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) );
20062
 
20063
  /**
@@ -20574,9 +21583,7 @@
20574
  * @since 2.1.0
20575
  */
20576
  function _maybe_add_gdpr_optin_ajax_handler() {
20577
- if ( $this->is_activation_mode() ) {
20578
- $this->add_ajax_action( 'fetch_is_marketing_required_flag_value', array( &$this, '_fetch_is_marketing_required_flag_value_ajax_action' ) );
20579
- }
20580
 
20581
  if ( FS_GDPR_Manager::instance()->is_opt_in_notice_shown() ) {
20582
  $this->add_gdpr_optin_ajax_handler_and_style();
@@ -20760,4 +21767,28 @@
20760
  }
20761
 
20762
  #endregion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20763
  }
33
  * @var string
34
  */
35
  private $_plugin_basename;
36
+ /**
37
+ * @since 2.2.1
38
+ *
39
+ * @var string
40
+ */
41
+ private $_premium_plugin_basename;
42
  /**
43
  * @since 1.0.0
44
  *
677
  version_compare( $sdk_version, '1.2.3', '>=' )
678
  ) {
679
  /**
680
+ * Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be
681
+ * invalid.
682
  *
683
  * @author Leo Fajardo (@leorw)
684
  */
685
+ $this->remove_invalid_paths();
686
  }
687
 
688
  if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
706
 
707
  }
708
  }
709
+
710
+ if (
711
+ version_compare( $sdk_prev_version, '2.2.1', '<' ) &&
712
+ version_compare( $sdk_version, '2.2.1', '>=' )
713
+ ) {
714
+ /**
715
+ * Clear the file cache without storing the previous path since it could be a wrong path. For example,
716
+ * in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same
717
+ * as the parent plugin's when the add-on was auto-installed since the relevant method names were not
718
+ * skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method
719
+ * (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin
720
+ * and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues
721
+ * related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
722
+ *
723
+ * @author Leo Fajardo (@leorw)
724
+ * @since 2.2.1
725
+ */
726
+ $this->clear_module_main_file_cache( false );
727
+ }
728
  }
729
 
730
  /**
850
  }
851
 
852
  /**
853
+ * Remove invalid paths.
854
  *
855
  * @author Leo Fajardo (@leorw)
856
  * @since 1.2.3
857
  */
858
+ private function remove_invalid_paths() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
859
  // Remove invalid path that is still associated with the current slug if there's any.
860
  $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
861
  foreach ( $file_slug_map as $plugin_basename => $slug ) {
1238
  <?php
1239
  }
1240
 
1241
+ /**
1242
+ * Opens the support forum subemenu item in a new browser page.
1243
+ *
1244
+ * @author Vova Feldman (@svovaf)
1245
+ * @since 2.1.4
1246
+ */
1247
+ static function _open_support_forum_in_new_page() {
1248
+ ?>
1249
+ <script type="text/javascript">
1250
+ (function ($) {
1251
+ $('.fs-submenu-item.wp-support-forum').parent().attr('target', '_blank');
1252
+ })(jQuery);
1253
+ </script>
1254
+ <?php
1255
+ }
1256
+
1257
  /**
1258
  * @author Vova Feldman (@svovaf)
1259
  * @since 1.0.9
1265
  add_action( 'plugins_loaded', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
1266
 
1267
  if ( $this->is_plugin() ) {
1268
+ if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) {
1269
+ /**
1270
+ * Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, make
1271
+ * Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php)
1272
+ * so that they won't interfere with the .org plugins' functionalities on that page (e.g.
1273
+ * updating of a .org plugin).
1274
+ */
1275
+ add_filter( 'site_transient_update_plugins', array( 'Freemius', '_remove_fs_updates_from_plugin_install_page' ), 10, 2 );
1276
+ } else if ( self::is_plugins_page() || self::is_updates_page() ) {
1277
+ /**
1278
+ * On the "Plugins" and "Updates" admin pages, if there are premium or non–org-compliant
1279
+ * plugins, modify their details dialog URLs (add a Freemius-specific param) so that the SDK can
1280
+ * determine if the plugin information dialog should show information from Freemius.
1281
+ *
1282
+ * @author Leo Fajardo (@leorw)
1283
+ * @since 2.2.3
1284
+ */
1285
+ add_action( 'admin_footer', array( 'Freemius', '_prepend_fs_allow_updater_and_dialog_flag_url_param' ) );
1286
+ }
1287
+
1288
  $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
1289
 
1290
  /**
1392
  add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1393
  }
1394
 
1395
+ if ( $this->is_theme() &&
1396
+ self::is_customizer() &&
1397
+ $this->apply_filters( 'show_customizer_upsell', true )
1398
+ ) {
1399
  // Register customizer upsell.
1400
  add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1401
  }
1452
  }
1453
  }
1454
 
1455
+ /**
1456
+ * Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that
1457
+ * they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin).
1458
+ *
1459
+ * @author Leo Fajardo (@leorw)
1460
+ * @since 2.2.3
1461
+ *
1462
+ * @param object $updates
1463
+ * @param string|null $transient
1464
+ *
1465
+ * @return object
1466
+ */
1467
+ static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) {
1468
+ if ( is_object( $updates ) && isset( $updates->response ) ) {
1469
+ foreach ( $updates->response as $file => $plugin ) {
1470
+ if ( false !== strpos( $plugin->package, 'api.freemius' ) ) {
1471
+ unset( $updates->response[ $file ] );
1472
+ }
1473
+ }
1474
+ }
1475
+
1476
+ return $updates;
1477
+ }
1478
+
1479
+ /**
1480
+ * Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle
1481
+ * the information that is shown on the plugin details dialog that is shown when the relevant link is clicked.
1482
+ *
1483
+ * @author Leo Fajardo (@leorw)
1484
+ * @since 2.2.3
1485
+ *
1486
+ * @return string
1487
+ */
1488
+ static function _prepend_fs_allow_updater_and_dialog_flag_url_param() {
1489
+ $slug_basename_map = array();
1490
+ foreach ( self::$_instances as $instance ) {
1491
+ if ( ! $instance->is_plugin() ) {
1492
+ continue;
1493
+ }
1494
+
1495
+ $slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename();
1496
+ }
1497
+ ?>
1498
+ <script type="text/javascript">
1499
+ (function( $ ) {
1500
+ var slugBasenameMap = <?php echo json_encode( $slug_basename_map ) ?>;
1501
+ for ( var slug in slugBasenameMap ) {
1502
+ var basename = slugBasenameMap[ slug ];
1503
+
1504
+ // Try to get the plugin rows if on the "Plugins" page.
1505
+ var $pluginRows = $( '.wp-list-table.plugins tr[data-plugin="' + basename + '"]');
1506
+
1507
+ if ( 0 === $pluginRows.length ) {
1508
+ // Try to get the plugin rows if on the "Updates" page.
1509
+ var $pluginCheckbox = $( '#update-plugins-table input[type="checkbox"][value="' + basename + '"]' );
1510
+ if ( 0 !== $pluginCheckbox.length ) {
1511
+ $pluginRows = $pluginCheckbox.parents( 'tr:first' );
1512
+ }
1513
+ }
1514
+
1515
+ if ( 0 === $pluginRows.length ) {
1516
+ // No plugin rows found.
1517
+ continue;
1518
+ }
1519
+
1520
+ // Find the "View details" links and add the `fs_allow_updater_and_dialog` param to the URL.
1521
+ $pluginRows.find( 'a[href*="plugin-install.php?tab=plugin-information"]' ).each(function() {
1522
+ var $this = $( this ),
1523
+ href = $this.attr( 'href' ).replace( '?tab=', '?fs_allow_updater_and_dialog=true&tab=');
1524
+
1525
+ $this.attr( 'href', href );
1526
+ });
1527
+ }
1528
+ })( jQuery );
1529
+ </script>
1530
+ <?php
1531
+ }
1532
+
1533
  /**
1534
  * Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
1535
  * could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
1550
 
1551
  /**
1552
  * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
1553
+ *
1554
+ * @param bool $store_prev_path
1555
  */
1556
+ private function clear_module_main_file_cache( $store_prev_path = true ) {
1557
  if ( ! isset( $this->_storage->plugin_main_file ) ||
1558
+ empty( $this->_storage->plugin_main_file->path )
1559
  ) {
1560
  return;
1561
  }
1562
 
1563
+ if ( ! $store_prev_path ) {
1564
+ /**
1565
+ * Storing the previous path is not needed when clearing the cache after an SDK version update since
1566
+ * the main purpose of the cache clearing in that event is to correct a wrong plugin main file path
1567
+ * which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
1568
+ *
1569
+ * @author Leo Fajardo (@leorw)
1570
+ * @since 2.2.1
1571
+ */
1572
+ unset( $this->_storage->plugin_main_file->path );
1573
+ } else {
1574
+ $plugin_main_file = clone $this->_storage->plugin_main_file;
1575
 
1576
+ // Store cached path (2nd layer cache).
1577
+ $plugin_main_file->prev_path = $plugin_main_file->path;
1578
 
1579
+ // Clear cached path.
1580
+ unset( $plugin_main_file->path );
1581
 
1582
+ $this->_storage->plugin_main_file = $plugin_main_file;
1583
+ }
1584
 
1585
  /**
1586
  * Clear global cached path.
1627
  array( &$this, '_submit_uninstall_reason_action' )
1628
  );
1629
 
1630
+ $this->add_ajax_action(
1631
+ 'cancel_subscription_or_trial',
1632
+ array( &$this, 'cancel_subscription_or_trial_ajax_action' )
1633
+ );
 
 
1634
 
1635
  if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
1636
  if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
1756
 
1757
  return fs_normalize_path( trailingslashit( $is_plugin ?
1758
  WP_PLUGIN_DIR :
1759
+ get_theme_root( get_stylesheet() ) ) );
1760
  }
1761
 
1762
  /**
1821
  private function get_caller_main_file_and_type() {
1822
  self::require_plugin_essentials();
1823
 
1824
+ $all_plugins = fs_get_plugins( true );
1825
  $all_plugins_paths = array();
1826
 
1827
  // Get active plugin's main files real full names (might be symlinks).
1828
+ foreach ( $all_plugins as $relative_path => $data ) {
1829
  if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
1830
  /**
1831
  * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
1843
  $caller_file_candidate = false;
1844
  $caller_map = array();
1845
  $module_type = WP_FS__MODULE_TYPE_PLUGIN;
1846
+ $themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) );
1847
 
1848
  for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
1849
  if ( empty( $bt[ $i ]['file'] ) ) {
1863
  'requir' . 'e_once',
1864
  'requir' . 'e',
1865
  'includ' . 'e_once',
1866
+ 'includ' . 'e',
1867
+ 'install_and_activate_plugin',
1868
+ 'try_activate_plugin',
1869
+ 'activate_plugin'
1870
  ) )
1871
  ) {
1872
  // Ignore call stack hooks and files inclusion.
2202
  exit;
2203
  }
2204
 
2205
+ /**
2206
+ * @author Leo Fajardo (@leorw)
2207
+ * @since 2.1.4
2208
+ */
2209
+ function cancel_subscription_or_trial_ajax_action() {
2210
+ $this->_logger->entrance();
2211
+
2212
+ $this->check_ajax_referer( 'cancel_subscription_or_trial' );
2213
+
2214
+ $result = $this->cancel_subscription_or_trial( fs_request_get( 'plugin_id', $this->get_id() ), false );
2215
+
2216
+ if ( $this->is_api_error( $result ) ) {
2217
+ $this->shoot_ajax_failure( $result->error->message );
2218
+ }
2219
+
2220
+ $this->shoot_ajax_success();
2221
+ }
2222
+
2223
+ /**
2224
+ * @author Leo Fajardo (@leorw)
2225
+ * @since 2.1.4
2226
+ *
2227
+ * @param number $plugin_id
2228
+ *
2229
+ * @return object
2230
+ */
2231
+ private function cancel_subscription_or_trial( $plugin_id ) {
2232
+ $fs = null;
2233
+ if ( $plugin_id == $this->get_id() ) {
2234
+ $fs = $this;
2235
+ } else if ( $this->is_addon_activated( $plugin_id ) ) {
2236
+ $fs = self::get_instance_by_id( $plugin_id );
2237
+ }
2238
+
2239
+ $result = null;
2240
+
2241
+ if ( ! is_null( $fs ) ) {
2242
+ $result = $fs->is_paid_trial() ?
2243
+ $fs->_cancel_trial() :
2244
+ $fs->_downgrade_site();
2245
+ }
2246
+
2247
+ return $result;
2248
+ }
2249
+
2250
  /**
2251
  * @author Leo Fajardo (@leorw)
2252
  * @since 2.0.2
2323
  * @since 1.2.2
2324
  *
2325
  * @param string|number $id_or_slug
2326
+ * @param string $module_type
2327
  *
2328
  * @return number|false
2329
  */
2330
+ private static function get_module_id( $id_or_slug, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
2331
  if ( is_numeric( $id_or_slug ) ) {
2332
  return $id_or_slug;
2333
  }
2334
 
2335
  foreach ( self::$_instances as $instance ) {
2336
+ // Also check the module type since there can be a plugin and a theme with the same slug.
2337
+ if ( ( $module_type === $instance->get_module_type() ) && ( $id_or_slug === $instance->get_slug() ) ) {
2338
  return $instance->get_id();
2339
  }
2340
  }
2361
  * @author Vova Feldman (@svovaf)
2362
  * @since 1.0.1
2363
  *
2364
+ * @param string $plugin_file
2365
+ * @param string $module_type
2366
  *
2367
  * @return false|Freemius
2368
  */
2369
+ static function get_instance_by_file( $plugin_file, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
2370
  $slug = self::find_slug_by_basename( $plugin_file );
2371
 
2372
  return ( false !== $slug ) ?
2373
+ self::instance( self::get_module_id( $slug, $module_type ) ) :
2374
  false;
2375
  }
2376
 
2484
  function is_site_activation_mode( $and_on = true ) {
2485
  return (
2486
  ( $this->is_on() || ! $and_on ) &&
2487
+ ( $this->is_premium() && true === $this->_storage->require_license_activation ) ||
2488
+ (
2489
+ ( ! $this->is_registered() ||
2490
+ ( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) &&
2491
+ ( ! $this->is_enable_anonymous() ||
2492
+ ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
2493
+ )
2494
  );
2495
  }
2496
 
2525
  return false;
2526
  }
2527
 
2528
+ if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) {
2529
  // Super-admin skipped the connection network wide -> not activation mode.
2530
  return false;
2531
  }
2646
  self::require_plugin_essentials();
2647
 
2648
  $active_plugin = array();
2649
+ $all_plugins = fs_get_plugins();
2650
  $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
2651
 
2652
  foreach ( $active_plugins_basenames as $plugin_basename ) {
2672
  get_option( 'active_plugins' );
2673
 
2674
  $active = array();
2675
+
2676
+ if ( ! is_array( $active_basenames ) ) {
2677
+ return $active;
2678
+ }
2679
+
2680
  foreach ( $active_basenames as $basename ) {
2681
  $active[ $basename ] = array(
2682
  'is_active' => true,
2701
  private static function get_all_plugins( $blog_id = 0 ) {
2702
  self::require_plugin_essentials();
2703
 
2704
+ $all_plugins = fs_get_plugins();
2705
 
2706
  $active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
2707
 
2733
  private static function get_network_plugins() {
2734
  self::require_plugin_essentials();
2735
 
2736
+ $all_plugins = fs_get_plugins();
2737
 
2738
  $network_active_basenames = is_multisite() ?
2739
  get_site_option( 'active_sitewide_plugins' ) :
2830
  self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
2831
 
2832
  if ( is_multisite() ) {
2833
+ $has_skipped_migration = (
2834
+ // 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
2835
+ null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
2836
+ // 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
2837
+ null !== self::$_accounts->get_option( 'file_slug_map', null, false )
2838
+ );
2839
+
2840
  /**
2841
+ * If the file_slug_map exists on the site level but doesn't exist on the
2842
  * network level storage, it means that we need to process the storage with migration.
2843
  *
2844
+ * The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
2845
  *
2846
  * @author Vova Feldman (@svovaf)
2847
  * @since 2.0.0
2848
  */
2849
+ if (
2850
+ ( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
2851
+ ( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
2852
+ null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
2853
  ) {
2854
+ self::migrate_options_to_network();
 
 
 
 
 
 
 
2855
  }
2856
  }
2857
 
2877
  }
2878
 
2879
  add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
2880
+ add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );
2881
+
2882
 
2883
  self::$_statics_loaded = true;
2884
  }
2885
 
2886
+ /**
2887
+ * @author Leo Fajardo (@leorw)
2888
+ *
2889
+ * @since 2.1.3
2890
+ */
2891
+ private static function migrate_options_to_network() {
2892
+ self::migrate_accounts_to_network();
2893
+
2894
+ // Migrate API options from site level to network level.
2895
+ $api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
2896
+ $api_network_options->migrate_to_network();
2897
+
2898
+ // Migrate API cache to network level storage.
2899
+ FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
2900
+
2901
+ self::$_accounts->set_option( 'ms_migration_complete', true, true );
2902
+ }
2903
+
2904
  #----------------------------------------------------------------------------------
2905
  #region Localization
2906
  #----------------------------------------------------------------------------------
2977
  * @since 1.1.7.3
2978
  */
2979
  static function _toggle_debug_mode() {
2980
+ if ( ! is_super_admin() ) {
2981
+ return;
2982
+ }
2983
+
2984
  $is_on = fs_request_get( 'is_on', false, 'post' );
2985
 
2986
  if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
3012
  * @since 1.2.1.7
3013
  */
3014
  static function _get_db_option() {
3015
+ check_admin_referer( 'fs_get_db_option' );
3016
+
3017
  $option_name = fs_request_get( 'option_name' );
3018
 
3019
+ if ( ! is_super_admin() ||
3020
+ ! fs_starts_with( $option_name, 'fs_' )
3021
+ ) {
3022
+ self::shoot_ajax_failure();
3023
+ }
3024
+
3025
  $value = get_option( $option_name );
3026
 
3027
  $result = array(
3044
  * @since 1.2.1.7
3045
  */
3046
  static function _set_db_option() {
3047
+ check_admin_referer( 'fs_set_db_option' );
3048
+
3049
+ $option_name = fs_request_get( 'option_name' );
3050
+
3051
+ if ( ! is_super_admin() ||
3052
+ ! fs_starts_with( $option_name, 'fs_' )
3053
+ ) {
3054
+ self::shoot_ajax_failure();
3055
+ }
3056
+
3057
  $option_value = fs_request_get( 'option_value' );
3058
 
3059
  if ( ! empty( $option_value ) ) {
3148
  }
3149
 
3150
  fs_redirect( $download_url );
3151
+ } else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
3152
+ check_admin_referer( 'migrate_options_to_network' );
3153
+
3154
+ self::migrate_options_to_network();
3155
  }
3156
  }
3157
 
3506
  */
3507
  static function _get_current_wp_user() {
3508
  self::require_pluggable_essentials();
3509
+ self::wp_cookie_constants();
3510
 
3511
  return wp_get_current_user();
3512
  }
3513
 
3514
+ /**
3515
+ * Define cookie constants which are required by Freemius::_get_current_wp_user() since
3516
+ * it uses wp_get_current_user() which needs the cookie constants set. When a plugin
3517
+ * is network activated the cookie constants are only configured after the network
3518
+ * plugins activation, therefore, if we don't define those constants WP will throw
3519
+ * PHP warnings/notices.
3520
+ *
3521
+ * @author Vova Feldman (@svovaf)
3522
+ * @since 2.1.1
3523
+ */
3524
+ private static function wp_cookie_constants() {
3525
+ if ( defined( 'LOGGED_IN_COOKIE' ) &&
3526
+ ( defined( 'AUTH_COOKIE' ) || defined( 'SECURE_AUTH_COOKIE' ) )
3527
+ ) {
3528
+ return;
3529
+ }
3530
+
3531
+ /**
3532
+ * Used to guarantee unique hash cookies
3533
+ *
3534
+ * @since 1.5.0
3535
+ */
3536
+ if ( ! defined( 'COOKIEHASH' ) ) {
3537
+ $siteurl = get_site_option( 'siteurl' );
3538
+ if ( $siteurl ) {
3539
+ define( 'COOKIEHASH', md5( $siteurl ) );
3540
+ } else {
3541
+ define( 'COOKIEHASH', '' );
3542
+ }
3543
+ }
3544
+
3545
+ if ( ! defined( 'LOGGED_IN_COOKIE' ) ) {
3546
+ define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
3547
+ }
3548
+
3549
+ /**
3550
+ * @since 2.5.0
3551
+ */
3552
+ if ( ! defined( 'AUTH_COOKIE' ) ) {
3553
+ define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
3554
+ }
3555
+
3556
+ /**
3557
+ * @since 2.6.0
3558
+ */
3559
+ if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {
3560
+ define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
3561
+ }
3562
+ }
3563
+
3564
  /**
3565
  * @author Vova Feldman (@svovaf)
3566
  * @since 2.1.0
4204
 
4205
  $this->parse_settings( $plugin_info );
4206
 
4207
+ if ( is_admin() && $this->is_theme() && $this->is_premium() && ! $this->has_active_valid_license() ) {
4208
+ $this->add_ajax_action(
4209
+ 'delete_theme_update_data',
4210
+ array( &$this, '_delete_theme_update_data_action' )
4211
+ );
4212
+ }
4213
+
4214
  if ( ! self::is_ajax() ) {
4215
  if ( ! $this->is_addon() || $this->is_only_premium() ) {
4216
  add_action(
4291
  * @author Vova Feldman (@svovaf)
4292
  */
4293
  if ( $this->is_user_in_admin() &&
4294
+ 'plugin-information' === fs_request_get( 'tab', false ) &&
4295
+ $this->should_use_freemius_updater_and_dialog() &&
4296
+ (
4297
+ ( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) ||
4298
+ ( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) )
4299
+ )
4300
  ) {
4301
  require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
4302
 
4303
+ new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this );
4304
  }
4305
 
4306
  // Check if Freemius is on for the current plugin.
4414
  * @author Vova Feldman
4415
  * @since 1.2.1.6
4416
  */
4417
+ if (
4418
+ $this->should_use_freemius_updater_and_dialog() &&
4419
+ (
4420
+ $this->is_premium() ||
4421
+ /**
4422
+ * If not premium but the premium version is installed, also instantiate the updater so that the
4423
+ * plugin information dialog of the premium version will have the information from the server.
4424
+ *
4425
+ * @author Leo Fajardo (@leorw)
4426
+ * @since 2.2.3
4427
+ */
4428
+ ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) )
4429
+ ) &&
4430
+ $this->has_release_on_freemius()
4431
+ ) {
4432
  FS_Plugin_Updater::instance( $this );
4433
  }
4434
 
4471
  }
4472
  }
4473
 
4474
+ /**
4475
+ * @author Leo Fajardo (@leorw)
4476
+ * @since 2.2.3
4477
+ *
4478
+ * @return bool
4479
+ */
4480
+ private function should_use_freemius_updater_and_dialog() {
4481
+ return (
4482
+ /**
4483
+ * Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, disallow updater
4484
+ * and dialog on the "Add Plugins" admin page (/plugin-install.php) so that they won't interfere with
4485
+ * the .org plugins' functionalities on that page (e.g. installation and viewing plugin details from
4486
+ * .org).
4487
+ */
4488
+ ( ! self::is_plugin_install_page() || true === fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) &&
4489
+ // Disallow updater and dialog when installing a plugin, otherwise .org "add-on" plugins will be affected.
4490
+ ( 'install-plugin' !== fs_request_get( 'action' ) )
4491
+ );
4492
+ }
4493
+
4494
  /**
4495
  * @author Leo Fajardo (@leorw)
4496
  *
4927
  $this->_plugin :
4928
  new FS_Plugin();
4929
 
4930
+ $premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' );
4931
+
4932
  $plugin->update( array(
4933
  'id' => $id,
4934
  'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ),
4935
  'public_key' => $public_key,
4936
  'slug' => $this->_slug,
4937
+ 'premium_slug' => $this->get_option( $plugin_info, 'premium_slug', "{$this->_slug}-premium" ),
4938
  'parent_plugin_id' => $parent_id,
4939
  'version' => $this->get_plugin_version(),
4940
+ 'title' => $this->get_plugin_name( $premium_suffix ),
4941
  'file' => $this->_plugin_basename,
4942
  'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
4943
+ 'premium_suffix' => $premium_suffix,
4944
  'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
4945
  'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
4946
  ) );
5321
  }
5322
 
5323
  $addon = $this->get_addon( $addon_id );
5324
+ $premium_basename = "{$addon->premium_slug}/{$addon->slug}.php";
5325
 
5326
  if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) {
5327
  return $premium_basename;
5329
 
5330
  $all_plugins = $this->get_all_plugins();
5331
 
5332
+ foreach ( $all_plugins as $basename => $data ) {
5333
  if ( $addon->slug === $data['slug'] ||
5334
+ $addon->premium_slug === $data['slug']
5335
  ) {
5336
  return $basename;
5337
  }
5571
  if ( ! isset( $this->_is_anonymous ) ) {
5572
  if ( $this->is_network_anonymous() ) {
5573
  $this->_is_anonymous = true;
5574
+ } else if ( ! fs_is_network_admin() ) {
5575
  if ( ! isset( $this->_storage->is_anonymous ) ) {
5576
  // Not skipped.
5577
  $this->_is_anonymous = false;
5762
  $this->_storage->store( "{$name}_timestamp", time() );
5763
  }
5764
 
5765
+ /**
5766
+ * Sets the keepalive time to now.
5767
+ *
5768
+ * @author Leo Fajardo (@leorw)
5769
+ * @since 2.2.3
5770
+ *
5771
+ * @param bool|null $use_network_level_storage
5772
+ */
5773
+ private function set_keepalive_timestamp( $use_network_level_storage = null ) {
5774
+ $this->_logger->entrance();
5775
+
5776
+ $this->_storage->store( 'keepalive_timestamp', time(), $use_network_level_storage );
5777
+ }
5778
+
5779
  /**
5780
  * Check if cron was executed in the last $period of seconds.
5781
  *
5790
  private function is_cron_executed( $name, $period = WP_FS__TIME_24_HOURS_IN_SEC ) {
5791
  $this->_logger->entrance( $name );
5792
 
5793
+ $last_execution = $this->cron_last_execution( $name );
5794
 
5795
  if ( ! is_numeric( $last_execution ) ) {
5796
  return false;
6051
  }
6052
  }
6053
 
6054
+ $current_blog_id = get_current_blog_id();
6055
+
6056
  foreach ( $users_2_blog_ids as $user_id => $blog_ids ) {
6057
  if ( 0 < $blog_ids[0] ) {
6058
  $this->switch_to_blog( $blog_ids[0] );
6059
  }
6060
 
6061
+ call_user_func_array( $callable, array( $blog_ids, ( is_multisite() ? $current_blog_id : null ) ) );
6062
 
6063
  foreach ( $blog_ids as $blog_id ) {
6064
  $this->do_action( "after_{$name}_cron", $blog_id );
6066
  }
6067
 
6068
  if ( is_multisite() ) {
6069
+ $this->switch_to_blog( $current_blog_id );
6070
+
6071
  $this->do_action( "after_{$name}_cron_multisite" );
6072
  }
6073
  }
6139
  * @author Vova Feldman (@svovaf)
6140
  * @since 2.0.0
6141
  *
6142
+ * @param int[] $blog_ids
6143
+ * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the
6144
+ * `_sync_plugin_license` method in order to switch to the previous blog when sending
6145
+ * updates for a single site in case `execute_cron` has switched to a different blog.
6146
  */
6147
+ function _sync_cron_method( array $blog_ids, $current_blog_id = null ) {
6148
  if ( $this->is_registered() ) {
6149
  if ( $this->has_paid_plan() ) {
6150
  // Initiate background plan sync.
6151
+ $this->_sync_license( true, false, $current_blog_id );
6152
 
6153
  if ( $this->is_paying() ) {
6154
  // Check for premium plugin updates.
6295
  * @param int $except_blog_id Since 2.0.0 when running in a multisite network environment, the cron execution is consolidated. This param allows excluding excluded specified blog ID from being the cron executor.
6296
  */
6297
  private function schedule_install_sync( $except_blog_id = 0 ) {
6298
+ $this->schedule_cron( 'install_sync', 'install_sync', 'single', WP_FS__SCRIPT_START_TIME, false, $except_blog_id );
6299
  }
6300
 
6301
  /**
6363
  * @author Vova Feldman (@svovaf)
6364
  * @since 2.0.0
6365
  *
6366
+ * @param int[] $blog_ids
6367
+ * @param int|null $current_blog_id
6368
  */
6369
+ function _sync_install_cron_method( array $blog_ids, $current_blog_id = null ) {
6370
  if ( $this->is_registered() ) {
6371
  if ( 1 < count( $blog_ids ) ) {
6372
  $this->sync_installs( array(), true );
6470
  if ( ! $this->is_addon() &&
6471
  ! ( ! $this->_is_network_active && fs_is_network_admin() ) &&
6472
  (
6473
+ ( true === $this->_storage->require_license_activation ) ||
6474
  // Not registered nor anonymous.
6475
  ( ! $this->is_registered() && ! $this->is_anonymous() ) ||
6476
  // OR, network level and in network upgrade mode.
6487
  * @since 1.2.2
6488
  */
6489
  if ( $this->is_theme()
 
6490
  && ! $this->has_settings_menu()
6491
  && ! isset( $_REQUEST['fs_action'] )
6492
  && $this->can_activate_previous_theme()
6493
  ) {
6494
+ if ( $this->is_only_premium() ) {
6495
+ $this->activate_previous_theme();
6496
+ return;
6497
+ }
6498
 
6499
+ if ( true === $this->_storage->require_license_activation ) {
6500
+ $this->_storage->require_license_activation = false;
6501
+ }
6502
  }
6503
 
6504
  if ( ! fs_is_network_admin() &&
6509
  }
6510
 
6511
  if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
6512
+ if ( ! $this->_anonymous_mode ) {
6513
+ // Show notice for new plugin installations.
6514
+ $this->_admin_notices->add(
6515
+ sprintf(
6516
+ $this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
6517
+ sprintf( '<b><a href="%s">%s</a></b>',
6518
+ $this->get_activation_url( array(), ! $this->is_delegated_connection() ),
6519
+ sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
6520
+ '%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
6521
+ )
6522
+ ),
6523
+ '',
6524
+ 'update-nag'
6525
+ );
6526
+ }
6527
  } else {
6528
  if ( $this->should_add_sticky_optin_notice() ) {
6529
  $this->add_sticky_optin_admin_notice();
6598
  $this->_module_type,
6599
  sprintf( '<b><a href="%s">%s</a></b>',
6600
  $this->get_activation_url(),
6601
+ sprintf( $this->get_text_inline( 'Opt in to make "%s" better!', 'optin-x-now' ), $this->get_plugin_name() )
6602
  )
6603
  ),
6604
  'connect_account',
7060
  }
7061
  }
7062
 
7063
+ if (
7064
+ $is_premium_version_activation &&
7065
+ (
7066
+ ( ! $this->is_registered() && $this->is_anonymous() ) ||
7067
+ (
7068
+ $this->is_registered() &&
7069
+ ! $this->is_trial() &&
7070
+ ! $this->has_features_enabled_license()
7071
+ )
7072
+ )
7073
+ ) {
7074
+ $this->_storage->require_license_activation = true;
7075
+ }
7076
+
7077
  if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
7078
  /**
7079
  * If no previous version of plugin's version exist, it means that it's either
7343
  private function remove_sdk_reference() {
7344
  global $fs_active_plugins;
7345
 
7346
+ foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) {
7347
  if ( $this->_plugin_basename == $data->plugin_path ) {
7348
  unset( $fs_active_plugins->plugins[ $sdk_path ] );
7349
  break;
7525
  }
7526
  }
7527
 
7528
+ /**
7529
+ * This is used to ensure that before redirecting to the opt-in page after resetting the anonymous mode or
7530
+ * deleting the account in the network level, the URL of the page to redirect to is correct.
7531
+ *
7532
+ * @author Leo Fajardo (@leorw)
7533
+ *
7534
+ * @since 2.1.3
7535
+ */
7536
+ private function maybe_set_slug_and_network_menu_exists_flag() {
7537
+ if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
7538
+ $this->_menu->set_slug_and_network_menu_exists_flag( $this->_menu->has_menu() ?
7539
+ $this->_menu->get_slug() :
7540
+ $this->_slug
7541
+ );
7542
+ }
7543
+ }
7544
+
7545
  /**
7546
  * Clears the anonymous mode and redirects to the opt-in screen.
7547
  *
7555
 
7556
  $this->reset_anonymous_mode( fs_is_network_admin() );
7557
 
7558
+ $this->maybe_set_slug_and_network_menu_exists_flag();
7559
+
7560
  fs_redirect( $this->get_activation_url() );
7561
  }
7562
 
7996
  $include_plugins = true,
7997
  $include_themes = true
7998
  ) {
7999
+ if ( ! defined( 'WP_FS__TRACK_PLUGINS' ) || false !== WP_FS__TRACK_PLUGINS ) {
8000
+ /**
8001
+ * @since 1.1.8 Also send plugin updates.
8002
+ */
8003
+ if ( $include_plugins && ! isset( $override['plugins'] ) ) {
8004
+ $plugins = $this->get_plugins_data_for_api();
8005
+ if ( ! empty( $plugins ) ) {
8006
+ $override['plugins'] = $plugins;
8007
+ }
8008
  }
8009
  }
8010
+
8011
+ if ( ! defined( 'WP_FS__TRACK_THEMES' ) || false !== WP_FS__TRACK_THEMES ) {
8012
+ /**
8013
+ * @since 1.1.8 Also send themes updates.
8014
+ */
8015
+ if ( $include_themes && ! isset( $override['themes'] ) ) {
8016
+ $themes = $this->get_themes_data_for_api();
8017
+ if ( ! empty( $themes ) ) {
8018
+ $override['themes'] = $themes;
8019
+ }
8020
  }
8021
  }
8022
 
8023
+ $versions = $this->get_versions();
8024
+
8025
+ return array_merge( $versions, array(
8026
+ 'version' => $this->get_plugin_version(),
8027
+ 'is_premium' => $this->is_premium(),
8028
+ 'language' => get_bloginfo( 'language' ),
8029
+ 'charset' => get_bloginfo( 'charset' ),
8030
+ 'title' => get_bloginfo( 'name' ),
8031
+ 'url' => get_site_url(),
 
8032
  // Special params.
8033
+ 'is_active' => true,
8034
+ 'is_disconnected' => $this->is_tracking_prohibited(),
8035
+ 'is_uninstalled' => false,
8036
  ), $override );
8037
  }
8038
 
8077
  // }
8078
 
8079
  // Common properties.
8080
+ $versions = $this->get_versions();
8081
+ $common = array_merge( $versions, array(
8082
+ 'version' => $this->get_plugin_version(),
8083
+ 'is_premium' => $this->is_premium(),
 
 
8084
  ), $override );
8085
 
8086
 
8234
  $params = $this->get_install_diff_for_api( $check_properties, $this->_site, $override );
8235
  }
8236
 
8237
+ $keepalive_only_update = false;
8238
+ if ( empty( $params ) ) {
8239
+ $keepalive_only_update = $this->should_send_keepalive_update();
8240
+
8241
+ if ( ! $keepalive_only_update ) {
8242
+ /**
8243
+ * There are no updates to send including keepalive.
8244
+ *
8245
+ * @author Leo Fajardo (@leorw)
8246
+ * @since 2.2.3
8247
+ */
8248
+ return false;
8249
+ }
8250
+ }
8251
+
8252
+ if ( ! $keepalive_only_update ) {
8253
+ /**
8254
+ * Do not update the last install sync timestamp after a keepalive-only call since there were no actual
8255
+ * updates sent.
8256
+ *
8257
+ * @author Leo Fajardo (@leorw)
8258
+ * @since 2.2.3
8259
+ */
8260
  if ( ! is_multisite() ) {
8261
  // Update last install sync timestamp.
8262
  $this->set_cron_execution_timestamp( 'install_sync' );
8263
  }
8264
 
8265
  $params['uid'] = $this->get_anonymous_id();
8266
+ }
8267
 
8268
+ $this->set_keepalive_timestamp();
 
8269
 
8270
+ // Send updated values to FS.
8271
+ $site = $this->get_api_site_scope()->call( '/', 'put', $params );
 
 
 
 
8272
 
8273
+ if ( ! $keepalive_only_update && $this->is_api_result_entity( $site ) ) {
8274
+ /**
8275
+ * Do not clear scheduled sync after a keepalive-only call since there were no actual updates sent.
8276
+ *
8277
+ * @author Leo Fajardo (@leorw)
8278
+ * @since 2.2.3
8279
+ */
8280
+ if ( ! is_multisite() ) {
8281
+ // I successfully sent install update, clear scheduled sync if exist.
8282
+ $this->clear_install_sync_cron();
8283
+ }
8284
  }
8285
 
8286
+ return $site;
8287
  }
8288
 
8289
  /**
8302
 
8303
  $installs_data = $this->get_installs_data_for_api( $override, ! $flush );
8304
 
8305
+ $keepalive_only_update = false;
8306
  if ( empty( $installs_data ) ) {
8307
+ /**
8308
+ * Pass `true` to use the network level storage since the update is for many installs.
8309
+ *
8310
+ * @author Leo Fajardo (@leorw)
8311
+ * @since 2.2.3
8312
+ */
8313
+ $keepalive_only_update = $this->should_send_keepalive_update( true );
8314
+
8315
+ if ( ! $keepalive_only_update ) {
8316
+ /**
8317
+ * There are no updates to send including keepalive.
8318
+ *
8319
+ * @author Leo Fajardo (@leorw)
8320
+ * @since 2.2.3
8321
+ */
8322
+ return false;
8323
+ }
8324
  }
8325
 
8326
+ if ( ! $keepalive_only_update ) {
8327
+ // Update last install sync timestamp if there were actual updates sent (i.e., not a keepalive-only call).
8328
+ $this->set_cron_execution_timestamp( 'install_sync' );
8329
+ }
8330
+
8331
+ /**
8332
+ * Pass `true` to use the network level storage since the update is for many installs.
8333
+ *
8334
+ * @author Leo Fajardo (@leorw)
8335
+ * @since 2.2.3
8336
+ */
8337
+ $this->set_keepalive_timestamp( true );
8338
 
8339
  // Send updated values to FS.
8340
  $result = $this->get_api_user_scope()->call( "/plugins/{$this->_plugin->id}/installs.json", 'put', $installs_data );
8341
 
8342
+ if ( ! $keepalive_only_update && $this->is_api_result_object( $result, 'installs' ) ) {
8343
+ // I successfully sent installs update (there was an actual update sent and it's not just a keepalive-only call), clear scheduled sync if exist.
8344
  $this->clear_install_sync_cron();
8345
  }
8346
 
8347
  return $result;
8348
  }
8349
 
8350
+ /**
8351
+ * @author Leo Fajardo (@leorw)
8352
+ *
8353
+ * @param bool|null $use_network_level_storage
8354
+ *
8355
+ * @return bool
8356
+ */
8357
+ private function should_send_keepalive_update( $use_network_level_storage = null ) {
8358
+ $keepalive_timestamp = $this->_storage->get( 'keepalive_timestamp', 0, $use_network_level_storage );
8359
+
8360
+ if ( $keepalive_timestamp < ( time() - WP_FS__TIME_WEEK_IN_SEC ) ) {
8361
+ // If updated more than 7 days ago, trigger a keepalive and update the time it was triggered.
8362
+ return true;
8363
+ } else {
8364
+ // If updated 7 days ago or less, "flip a coin", if the value is 7 trigger a keepalive and update the last time it was triggered.
8365
+ return ( 7 == rand( 1, 7 ) );
8366
+ }
8367
+ }
8368
+
8369
  /**
8370
  * Update install only if changed.
8371
  *
8570
  // @todo Decide if we want to delete plugin information from db.
8571
  }
8572
 
8573
+ /**
8574
+ * Set the basename of the current product and hook _activate_plugin_event_hook() to the activation action.
8575
+ *
8576
+ * @author Vova Feldman (@svovaf)
8577
+ * @since 2.2.1
8578
+ *
8579
+ * @param string $is_premium
8580
+ * @param string $caller
8581
+ *
8582
+ * @return string
8583
+ */
8584
+ function set_basename( $is_premium, $caller ) {
8585
+ $basename = plugin_basename( $caller );
8586
+
8587
+ $current_basename = $is_premium ?
8588
+ $this->_premium_plugin_basename :
8589
+ $this->_free_plugin_basename;
8590
+
8591
+ if ( $current_basename == $basename ) {
8592
+ // Basename value set correctly.
8593
+ return;
8594
+ }
8595
+
8596
+ if ( $is_premium ) {
8597
+ $this->_premium_plugin_basename = $basename;
8598
+ } else {
8599
+ $this->_free_plugin_basename = $basename;
8600
+ }
8601
+
8602
+ $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
8603
+
8604
+ register_activation_hook(
8605
+ $plugin_dir . $basename,
8606
+ array( &$this, '_activate_plugin_event_hook' )
8607
+ );
8608
+ }
8609
+
8610
  /**
8611
  * @author Vova Feldman (@svovaf)
8612
  * @since 1.1.1
8613
+ * @since 2.2.1 If the context product is in its premium version, use the current module's basename, even if it was renamed.
8614
  *
8615
  * @return string
8616
  */
8617
  function premium_plugin_basename() {
8618
+ if ( ! isset( $this->_premium_plugin_basename ) ) {
8619
+ $this->_premium_plugin_basename = $this->is_premium() ?
8620
+ // The product is premium, so use the current basename.
8621
+ $this->_plugin_basename :
8622
+ $this->get_premium_slug() . '/' . basename( $this->_free_plugin_basename );
8623
+ }
8624
+
8625
+ return $this->_premium_plugin_basename;
8626
  }
8627
 
8628
  /**
8761
  }
8762
 
8763
  /**
8764
+ * @author Leo Fajardo (@leorw)
8765
+ * @since 2.2.1
8766
+ *
8767
+ * @return string
8768
+ */
8769
+ function get_premium_slug() {
8770
+ return is_object( $this->_plugin ) ?
8771
+ $this->_plugin->premium_slug :
8772
+ "{$this->_slug}-premium";
8773
+ }
8774
+
8775
+ /**
8776
+ * Retrieve the desired folder name for the product.
8777
+ *
8778
  * @author Vova Feldman (@svovaf)
8779
  * @since 1.2.1.7
8780
  *
8781
  * @return string Plugin slug.
8782
  */
8783
  function get_target_folder_name() {
8784
+ return $this->can_use_premium_code() ?
8785
+ $this->_plugin->premium_slug :
8786
+ $this->_slug;
8787
  }
8788
 
8789
  /**
8854
  * @author Vova Feldman (@svovaf)
8855
  * @since 1.0.9
8856
  *
8857
+ * @param string|bool $premium_suffix
8858
+ *
8859
  * @return string
8860
  */
8861
+ function get_plugin_name( $premium_suffix = false ) {
8862
  $this->_logger->entrance();
8863
 
8864
+ /**
8865
+ * This `if-else` can be squeezed into a single `if` but I intentionally split it for code readability.
8866
+ *
8867
+ * @author Vova Feldman
8868
+ */
8869
  if ( ! isset( $this->_plugin_name ) ) {
8870
+ // Name is not yet set.
8871
+ $this->set_name( $premium_suffix );
8872
+ } else if (
8873
+ ! empty( $premium_suffix ) &&
8874
+ ( ! is_object( $this->_plugin ) || $this->_plugin->premium_suffix !== $premium_suffix )
8875
+ ) {
8876
+ // Name is already set, but there's a change in the premium suffix.
8877
+ $this->set_name( $premium_suffix );
8878
+ }
8879
 
8880
+ return $this->_plugin_name;
8881
+ }
8882
 
8883
+ /**
8884
+ * Calculates and stores the product's name. This helper function was created specifically for get_plugin_name() just to make the code clearer.
8885
+ *
8886
+ * @author Vova Feldman (@svovaf)
8887
+ * @since 2.2.1
8888
+ *
8889
+ * @param string $premium_suffix
8890
+ */
8891
+ private function set_name( $premium_suffix = '' ) {
8892
+ $plugin_data = $this->get_plugin_data();
8893
 
8894
+ // Get name.
8895
+ $this->_plugin_name = $plugin_data['Name'];
8896
+
8897
+ if ( is_string( $premium_suffix ) ) {
8898
+ $premium_suffix = trim( $premium_suffix );
8899
 
8900
+ if ( ! empty( $premium_suffix ) ) {
8901
+ // Check if plugin name contains " (premium)" or a custom suffix and remove it.
8902
+ $suffix = ( ' ' . strtolower( $premium_suffix ) );
8903
+ $suffix_len = strlen( $suffix );
8904
+
8905
+ if ( strlen( $plugin_data['Name'] ) > $suffix_len &&
8906
+ $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len )
8907
+ ) {
8908
+ $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len );
8909
+ }
8910
+ }
8911
  }
8912
 
8913
+ $this->_logger->departure( 'Name = ' . $this->_plugin_name );
8914
  }
8915
 
8916
  /**
9616
  * @return bool
9617
  */
9618
  function is_premium() {
9619
+ /**
9620
+ * `$this->_plugin` will be `false` when `is_activation_mode` calls this method directly from the
9621
+ * `_register_hooks` method.
9622
+ *
9623
+ * @author Leo Fajardo (@leorw)
9624
+ * @since 2.2.3
9625
+ */
9626
+ return is_object( $this->_plugin ) ?
9627
+ $this->_plugin->is_premium :
9628
+ false;
9629
  }
9630
 
9631
  /**
11015
  fs_require_template( 'forms/resend-key.php', $vars );
11016
  }
11017
 
11018
+ /**
11019
+ * Displays a subscription cancellation dialog box when the user clicks on the "Deactivate License"
11020
+ * link on the "Account" page or deactivates a plugin and there's an active subscription that is
11021
+ * either associated with a non-lifetime single-site license or non-lifetime multisite license that
11022
+ * is only activated on a single production site.
11023
+ *
11024
+ * @author Leo Fajardo (@leorw)
11025
+ * @since 2.2.1
11026
+ *
11027
+ * @param bool $is_license_deactivation
11028
+ */
11029
+ function _maybe_add_subscription_cancellation_dialog_box( $is_license_deactivation = false ) {
11030
+ if ( fs_is_network_admin() ) {
11031
+ // Subscription cancellation dialog box is currently not supported for multisite networks.
11032
+ return;
11033
+ }
11034
+
11035
+ $license = $this->_get_license();
11036
+
11037
+ /**
11038
+ * If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation.
11039
+ *
11040
+ * @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf)
11041
+ * @since 2.2.1
11042
+ */
11043
+ if ( ! is_object( $license ) ||
11044
+ $license->is_lifetime() ||
11045
+ ( ! $license->is_single_site() && $license->activated > 1 )
11046
+ ) {
11047
+ return;
11048
+ }
11049
+
11050
+ /**
11051
+ * @var FS_Subscription $subscription
11052
+ */
11053
+ $subscription = $this->_get_subscription( $license->id );
11054
+ if ( ! is_object( $subscription ) || ! $subscription->is_active() ) {
11055
+ return;
11056
+ }
11057
+
11058
+ $vars = array(
11059
+ 'id' => $this->_module_id,
11060
+ 'license' => $license,
11061
+ 'has_trial' => $this->is_paid_trial(),
11062
+ 'is_license_deactivation' => $is_license_deactivation,
11063
+ );
11064
+
11065
+ fs_require_template( 'forms/subscription-cancellation.php', $vars );
11066
+ }
11067
+
11068
  /**
11069
  * @author Leo Fajardo (@leorw)
11070
  * @since 2.0.2
11149
  return;
11150
  }
11151
 
11152
+ if ( ! $this->is_premium() || $this->has_any_active_valid_license() ) {
11153
  // This is relevant only to the free versions and premium versions without an active license.
11154
  return;
11155
  }
11249
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
11250
  );
11251
 
11252
+ $install = $api->call( $fs->add_show_pending( '/' ), 'put', $params );
11253
 
11254
  if ( FS_Api::is_api_error( $install ) ) {
11255
  $error = FS_Api::is_api_error_object( $install ) ?
11342
  }
11343
  }
11344
 
11345
+ if ( false === $error && true === $this->_storage->require_license_activation ) {
11346
+ $this->_storage->require_license_activation = false;
11347
+ }
11348
+
11349
  $result = array(
11350
  'success' => ( false === $error )
11351
  );
11440
  $next_page = $this->get_after_activation_url( 'after_network_activation_url' );
11441
  }
11442
  } else {
11443
+ $error = $this->get_text_inline( 'Invalid site details collection.', 'invalid_site_details_collection' );
11444
  }
11445
 
11446
  $result = array(
11600
  static function get_current_page() {
11601
  if ( ! isset( self::$_pagenow ) ) {
11602
  global $pagenow;
11603
+ if ( empty( $pagenow ) && is_admin() && is_multisite() ) {
11604
+ /**
11605
+ * It appears that `$pagenow` is not yet initialized in some network admin pages when this method
11606
+ * is called, so initialize it here using some pieces of code from `wp-includes/vars.php`.
11607
+ *
11608
+ * @author Leo Fajardo (@leorw)
11609
+ * @since 2.2.3
11610
+ */
11611
+ if ( is_network_admin() ) {
11612
+ preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
11613
+ } else if ( is_user_admin() ) {
11614
+ preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
11615
+ } else {
11616
+ preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches );
11617
+ }
11618
+
11619
+ $pagenow = $self_matches[1];
11620
+ $pagenow = trim( $pagenow, '/' );
11621
+ $pagenow = preg_replace( '#\?.*?$#', '', $pagenow );
11622
+ if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) {
11623
+ $pagenow = 'index.php';
11624
+ } else {
11625
+ preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches );
11626
+ $pagenow = strtolower( $self_matches[1] );
11627
+ if ( '.php' !== substr($pagenow, -4, 4) )
11628
+ $pagenow .= '.php'; // for Options +Multiviews: /wp-admin/themes/index.php (themes.php is queried)
11629
+ }
11630
+ }
11631
 
11632
  self::$_pagenow = $pagenow;
11633
 
11659
  return ( 'plugins.php' === self::get_current_page() );
11660
  }
11661
 
11662
+ /**
11663
+ * @author Leo Fajardo (@leorw)
11664
+ * @since 2.2.3
11665
+ *
11666
+ * @return bool
11667
+ */
11668
+ static function is_plugin_install_page() {
11669
+ return ( 'plugin-install.php' === self::get_current_page() );
11670
+ }
11671
+
11672
  /**
11673
  * @author Leo Fajardo (@leorw)
11674
  * @since 2.0.2
11936
  return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true );
11937
  }
11938
 
11939
+ /**
11940
+ * @author Leo Fajardo (@leorw)
11941
+ * @since 2.1.4
11942
+ *
11943
+ * @param string $new_version
11944
+ *
11945
+ * @return string
11946
+ */
11947
+ function version_upgrade_checkout_link( $new_version ) {
11948
+ if ( ! is_object( $this->_license ) ) {
11949
+ $url = $this->pricing_url();
11950
+
11951
+ $purchase_license_text = $this->get_text_inline( 'Buy a license now', 'buy-license-now' );
11952
+ } else {
11953
+ $subscription = $this->_get_subscription( $this->_license->id );
11954
+
11955
+ $url = $this->checkout_url(
11956
+ is_object( $subscription ) ?
11957
+ ( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) :
11958
+ WP_FS__PERIOD_LIFETIME,
11959
+ false,
11960
+ array( 'licenses' => $this->_license->quota )
11961
+ );
11962
+
11963
+ $purchase_license_text = $this->get_text_inline( 'Renew your license now', 'renew-license-now' );
11964
+ }
11965
+
11966
+ return sprintf(
11967
+ $this->get_text_inline( '%s to access version %s security & feature updates, and support.', 'x-for-updates-and-support' ),
11968
+ sprintf( '<a href="%s">%s</a>', $url, $purchase_license_text ),
11969
+ $new_version
11970
+ );
11971
+ }
11972
+
11973
  /**
11974
  * Plugin's pricing URL.
11975
  *
12604
  * @author Vova Feldman (@svovaf)
12605
  */
12606
  $args = array(
12607
+ /**
12608
+ * Commented out in order to handle the migration of site options whether the site is public or not.
12609
+ *
12610
+ * @author Leo Fajardo (@leorw)
12611
+ * @since 2.2.1
12612
+ */
12613
+ // 'public' => 1,
12614
  'archived' => 0,
12615
  'mature' => 0,
12616
  'spam' => 0,
12806
 
12807
  self::$_accounts->set_site_blog_context( $blog_id );
12808
  $this->_storage->set_site_blog_context( $blog_id );
12809
+ $this->_storage->set_network_active( $this->_is_network_active, $this->is_delegated_connection( $blog_id ) );
12810
 
12811
  $this->_site = is_object( $install ) ?
12812
  $install :
13755
  }
13756
  }
13757
 
13758
+ if ( true === $this->_storage->require_license_activation &&
13759
+ ! fs_request_get_bool( 'require_license', true )
13760
+ ) {
13761
+ $this->_storage->require_license_activation = false;
13762
+ }
13763
+
13764
  if ( $this->is_theme() ) {
13765
  $this->_register_account_hooks();
13766
  }
13811
  * @param FS_Site $site
13812
  * @param bool|array $plans
13813
  */
13814
+ private function _set_account( FS_User $user, FS_Site $site, $plans = false ) {
13815
+ $site->user_id = $user->id;
13816
+
13817
+ $this->_site = $site;
13818
+ $this->_user = $user;
13819
+ if ( false !== $plans ) {
13820
+ $this->_plans = $plans;
13821
+ }
13822
+
13823
+ $this->send_install_update();
13824
+
13825
+ $this->_store_account();
13826
+
13827
+ }
13828
+
13829
+ /**
13830
+ * Get a sanitized array with the WordPress version, SDK version, and PHP version.
13831
+ * Each version is trimmed after the 16th char.
13832
+ *
13833
+ * @author Vova Feldman (@svovaf)
13834
+ * @since 2.2.1
13835
+ *
13836
+ * @return array
13837
+ */
13838
+ private function get_versions() {
13839
+ $versions = array();
13840
+ $versions['platform_version'] = get_bloginfo( 'version' );
13841
+ $versions['sdk_version'] = $this->version;
13842
+ $versions['programming_language_version'] = phpversion();
13843
 
13844
+ foreach ( $versions as $k => $version ) {
13845
+ if ( is_string( $versions[ $k ] ) && ! empty( $versions[ $k ] ) ) {
13846
+ $versions[ $k ] = substr( $versions[ $k ], 0, 16 );
13847
+ }
13848
  }
13849
 
13850
+ return $versions;
 
 
 
13851
  }
13852
 
13853
  /**
13871
  // Return to the module's main page.
13872
  $this->get_after_activation_url( 'after_connect_url', array( 'fs_action' => $activation_action ) );
13873
 
13874
+ $versions = $this->get_versions();
13875
+
13876
+ $params = array_merge( $versions, array(
13877
  'user_firstname' => $current_user->user_firstname,
13878
  'user_lastname' => $current_user->user_lastname,
13879
  'user_nickname' => $current_user->user_nicename,
13888
  'account',
13889
  array( 'fs_action' => 'sync_user' )
13890
  ), 'sync_user' ),
 
 
 
13891
  'is_premium' => $this->is_premium(),
13892
  'is_active' => true,
13893
  'is_uninstalled' => false,
13894
+ ) );
13895
 
13896
  if ( true === $network_level_or_blog_id ) {
13897
  if ( ! isset( $override_with['sites'] ) ) {
14077
  'timeout' => WP_FS__DEBUG_SDK ? 60 : 30,
14078
  );
14079
 
14080
+ $url = $this->add_show_pending( WP_FS__ADDRESS . '/action/service/user/install/' );
14081
  $response = self::safe_remote_post( $url, $request );
14082
 
14083
  if ( is_wp_error( $response ) ) {
15073
  unset( $parent_fs->_storage->is_pending_activation );
15074
  }
15075
 
15076
+ // Get user information based on parent's plugin.
15077
+ $user = $this->get_user();
15078
+
15079
  // First of all, set site info - otherwise we won't
15080
  // be able to invoke API calls.
15081
  $parent_fs->_site = new FS_Site( $parent_install );
15082
+ $parent_fs->_user = $user;
15083
 
15084
  // Sync add-on plans.
15085
  $parent_fs->_sync_plans();
15086
 
 
 
 
15087
  $parent_fs->_set_account( $user, $parent_fs->_site );
15088
  }
15089
 
15234
 
15235
  $hook = false;
15236
 
15237
+ if ( ! $this->has_settings_menu() ) {
15238
  // Add the opt-in page without a menu item.
15239
  $hook = FS_Admin_Menu_Manager::add_subpage(
15240
  null,
15447
  private function add_submenu_items() {
15448
  $this->_logger->entrance();
15449
 
15450
+ $is_activation_mode = $this->is_activation_mode();
15451
+
15452
  if ( $this->is_addon() ) {
15453
  // No submenu items for add-ons.
15454
  $add_submenu_items = false;
15455
  } else if ( $this->is_free_wp_org_theme() && ! fs_is_network_admin() ) {
15456
  // Also add submenu items when running in a free .org theme so the tabs will be visible.
15457
  $add_submenu_items = true;
15458
+ } else if ( $is_activation_mode && ! $this->is_free_wp_org_theme() ) {
15459
  $add_submenu_items = false;
15460
  } else if ( fs_is_network_admin() ) {
15461
  /**
15486
  $this->is_submenu_item_visible( 'affiliation' )
15487
  );
15488
  }
15489
+ }
15490
 
15491
+ if ( $add_submenu_items ||
15492
+ ( $is_activation_mode &&
15493
+ $this->is_only_premium() &&
15494
+ $this->is_admin_page( 'account' ) &&
15495
+ fs_request_is_action( $this->get_unique_affix() . '_sync_license' )
15496
+ )
15497
+ ) {
15498
  if ( ! WP_FS__DEMO_MODE && $this->is_registered() ) {
15499
  $show_account = (
15500
  $this->is_submenu_item_visible( 'account' ) &&
15513
  'account',
15514
  array( &$this, '_account_page_load' ),
15515
  WP_FS__DEFAULT_PRIORITY,
15516
+ ( $add_submenu_items && $show_account )
15517
  );
15518
  }
15519
+ }
15520
 
15521
+ if ( $add_submenu_items ) {
15522
  // Add contact page.
15523
  $this->add_submenu_item(
15524
  $this->get_text_inline( 'Contact Us', 'contact-us' ),
15543
  $this->is_submenu_item_visible( 'addons' )
15544
  );
15545
  }
15546
+ }
15547
 
15548
+ if ( $add_submenu_items ||
15549
+ ( $is_activation_mode && $this->is_only_premium() && $this->is_admin_page( 'pricing' ) )
15550
+ ) {
15551
  if ( ! WP_FS__DEMO_MODE ) {
15552
  $show_pricing = (
15553
  $this->is_submenu_item_visible( 'pricing' ) &&
15569
 
15570
  // Add upgrade/pricing page.
15571
  $this->add_submenu_item(
15572
+ $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? $this->get_text_x_inline( '&#x2190;', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '&#x27a4;', 'ASCII arrow right icon', 'symbol_arrow-right' ) ),
15573
  array( &$this, '_pricing_page_render' ),
15574
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
15575
  'manage_options',
15576
  'pricing',
15577
  'Freemius::_clean_admin_content_section',
15578
  WP_FS__LOWEST_PRIORITY,
15579
+ ( $add_submenu_items && $show_pricing ),
15580
  $pricing_class
15581
  );
15582
  }
15583
  }
15584
 
15585
+ if ( ! $is_activation_mode || ( true !== $this->_storage->require_license_activation ) ) {
15586
+ /**
15587
+ * Add the other menu items if there are any when not in activation mode or license activation is not
15588
+ * required (license activation is required for registered or anonymous users after activating the
15589
+ * premium version when the site is not in trial mode or there's no active valid license).
15590
+ *
15591
+ * @author Leo Fajardo (@leorw)
15592
+ * @since 2.2.1
15593
+ */
15594
+ if ( 0 < count( $this->_menu_items ) ) {
15595
+ if ( ! $this->_menu->is_top_level() ) {
15596
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
15597
 
15598
+ // Append submenu items right after the plugin's submenu item.
15599
+ $this->order_sub_submenu_items();
15600
+ } else {
15601
+ // Append submenu items.
15602
+ $this->embed_submenu_items();
15603
+ }
15604
  }
15605
  }
15606
  }
15626
 
15627
  foreach ( $this->_menu_items as $priority => $items ) {
15628
  foreach ( $items as $item ) {
 
 
 
 
 
 
 
 
 
 
15629
  $capability = ( ! empty( $item['capability'] ) ? $item['capability'] : $top_level_menu_capability );
15630
 
15631
  $menu_item = sprintf(
15636
  $item['menu_title']
15637
  );
15638
 
15639
+ $top_level_menu_slug = $this->get_top_level_menu_slug();
15640
+ $menu_slug = $this->_menu->get_slug( $item['menu_slug'] );
15641
 
15642
  if ( ! isset( $item['url'] ) ) {
15643
  $hook = FS_Admin_Menu_Manager::add_subpage(
15644
  $item['show_submenu'] ?
15645
+ $top_level_menu_slug :
15646
  null,
15647
  $item['page_title'],
15648
  $menu_item,
15657
  } else {
15658
  FS_Admin_Menu_Manager::add_subpage(
15659
  $item['show_submenu'] ?
15660
+ $top_level_menu_slug :
15661
  null,
15662
  $item['page_title'],
15663
  $menu_item,
15666
  array( $this, '' )
15667
  );
15668
  }
15669
+
15670
+ if ( $item['show_submenu'] && $is_first_submenu_item ) {
15671
+ if ( $this->_is_network_active && ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
15672
+ /**
15673
+ * If the top-level menu has been dynamically created, remove the first submenu item that
15674
+ * WordPress automatically creates when there's no submenu item whose slug matches the
15675
+ * parent's. In the following example, the `Awesome Plugin` submenu item will be removed.
15676
+ *
15677
+ * Awesome Plugin
15678
+ * - Awesome Plugin <-- we want to remove this since there's no real setting page for the top-level
15679
+ *
15680
+ * @author Leo Fajardo (@leorw)
15681
+ */
15682
+ remove_submenu_page( $top_level_menu_slug, $top_level_menu_slug );
15683
+ }
15684
+
15685
+ $is_first_submenu_item = false;
15686
+ }
15687
  }
15688
  }
15689
  }
16295
  return;
16296
  }
16297
 
16298
+ $site_clone = is_object( $site ) ? $site : $this->_site;
16299
+ $encrypted_site = clone $site_clone;
16300
 
16301
  $sites = self::get_all_sites( $this->_module_type, $network_level_or_blog_id );
16302
 
16664
  /**
16665
  * @since 1.2.3 When running in DEV mode, retrieve pending plans as well.
16666
  */
16667
+ $result = $api->get( $this->add_show_pending( "/plugins/{$this->_module_id}/plans.json" ), true );
16668
 
16669
  if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) {
16670
  for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) {
16926
  * @param bool|number $plugin_id
16927
  * @param bool $flush Since 1.1.7.3
16928
  * @param int $expiration Since 1.2.2.7
16929
+ * @param bool|string $newer_than Since 2.2.1
16930
  *
16931
  * @return object|false New plugin tag info if exist.
16932
  */
16933
+ private function _fetch_newer_version( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) {
16934
+ $latest_tag = $this->_fetch_latest_version( $plugin_id, $flush, $expiration, $newer_than );
16935
 
16936
  if ( ! is_object( $latest_tag ) ) {
16937
  return false;
16956
  * @param bool|number $plugin_id
16957
  * @param bool $flush Since 1.1.7.3
16958
  * @param int $expiration Since 1.2.2.7
16959
+ * @param bool|string $newer_than Since 2.2.1
16960
  *
16961
  * @return bool|FS_Plugin_Tag
16962
  */
16963
+ function get_update( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) {
16964
  $this->_logger->entrance();
16965
 
16966
  if ( ! is_numeric( $plugin_id ) ) {
16967
  $plugin_id = $this->_plugin->id;
16968
  }
16969
 
16970
+ $this->check_updates( true, $plugin_id, $flush, $expiration, $newer_than );
16971
  $updates = $this->get_all_updates();
16972
 
16973
  return isset( $updates[ $plugin_id ] ) && is_object( $updates[ $plugin_id ] ) ? $updates[ $plugin_id ] : false;
16996
  * @since 1.2.1
16997
  */
16998
  function has_active_valid_license() {
16999
+ return self::is_active_valid_license( $this->_license );
17000
+ }
17001
+
17002
+ /**
17003
+ * Check if a given license is active & valid (not expired).
17004
+ *
17005
+ * @author Vova Feldman (@svovaf)
17006
+ * @since 2.1.3
17007
+ *
17008
+ * @param FS_Plugin_License $license
17009
+ *
17010
+ * @return bool
17011
+ */
17012
+ private static function is_active_valid_license( $license ) {
17013
  return (
17014
+ is_object( $license ) &&
17015
+ FS_Plugin_License::is_valid_id( $license->id ) &&
17016
+ $license->is_active() &&
17017
+ $license->is_valid()
17018
  );
17019
  }
17020
 
17021
+ /**
17022
+ * Checks if there's any site that is associated with an active & valid license.
17023
+ * This logic is used to determine if the admin can download the premium code base from a network level admin.
17024
+ *
17025
+ * @author Vova Feldman (@svovaf)
17026
+ * @since 2.1.3
17027
+ *
17028
+ * @return bool
17029
+ */
17030
+ function has_any_active_valid_license() {
17031
+ if ( ! fs_is_network_admin() ) {
17032
+ return $this->has_active_valid_license();
17033
+ }
17034
+
17035
+ $installs = $this->get_blog_install_map();
17036
+ $all_plugin_licenses = self::get_all_licenses( $this->_module_id );
17037
+
17038
+ foreach ( $installs as $blog_id => $install ) {
17039
+ if ( ! FS_Plugin_License::is_valid_id( $install->license_id ) ) {
17040
+ continue;
17041
+ }
17042
+
17043
+ foreach ( $all_plugin_licenses as $license ) {
17044
+ if ( $license->id == $install->license_id ) {
17045
+ if ( self::is_active_valid_license( $license ) ) {
17046
+ return true;
17047
+ }
17048
+ }
17049
+ }
17050
+ }
17051
+
17052
+ return false;
17053
+ }
17054
+
17055
  /**
17056
  * Check if site assigned with license with enabled features.
17057
  *
17120
  * the admin.
17121
  * @param bool $is_context_single_site @since 2.0.0. This is used when syncing a license for a single install from the
17122
  * network-level "Account" page.
17123
+ * @param int|null $current_blog_id @since 2.2.3. This is passed from the `execute_cron` method and used by the
17124
+ * `_sync_plugin_license` method in order to switch to the previous blog when sending
17125
+ * updates for a single site in case `execute_cron` has switched to a different blog.
17126
  */
17127
+ private function _sync_license( $background = false, $is_context_single_site = false, $current_blog_id = null ) {
17128
  $this->_logger->entrance();
17129
 
17130
  $plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
17134
  if ( $is_addon_sync ) {
17135
  $this->_sync_addon_license( $plugin_id, $background );
17136
  } else {
17137
+ $this->_sync_plugin_license( $background, true, $is_context_single_site, $current_blog_id );
17138
  }
17139
 
17140
  $this->do_action( 'after_account_plan_sync', $this->get_plan_name() );
17185
  $this->_update_licenses( $licenses, $addon->id );
17186
 
17187
  if ( ! $this->is_addon_installed( $addon->id ) && FS_License_Manager::has_premium_license( $licenses ) ) {
17188
+ $plans_result = $this->get_api_site_or_plugin_scope()->get( $this->add_show_pending( "/addons/{$addon_id}/plans.json" ) );
17189
 
17190
  if ( ! isset( $plans_result->error ) ) {
17191
  $plans = array();
17224
  * @param bool $is_context_single_site Since 2.0.0. This is used when sending an update for a single install and
17225
  * syncing its license from the network-level "Account" page (e.g.: after
17226
  * activating a license only for the single install).
17227
+ * @param int|null $current_blog_id Since 2.2.3. This is passed from the `execute_cron` method so that it
17228
+ * can be used here to switch to the previous blog in case `execute_cron`
17229
+ * has switched to a different blog.
17230
  */
17231
  private function _sync_plugin_license(
17232
  $background = false,
17233
  $send_installs_update = true,
17234
+ $is_context_single_site = false,
17235
+ $current_blog_id = null
17236
  ) {
17237
  $this->_logger->entrance();
17238
 
17249
  * @todo This line will execute install sync on a daily basis, even if running the free version (for opted-in users). The reason we want to keep it that way is for cases when the user was a paying customer, then there was a failure in subscription payment, and then after some time the payment was successful. This could be heavily optimized. For example, we can skip the $flush if the current install was never associated with a paid version.
17250
  */
17251
  if ( $is_site_level_sync ) {
17252
+ /**
17253
+ * Switch to the previous blog since `execute_cron` may have switched to a different blog.
17254
+ *
17255
+ * @author Leo Fajardo (@leorw)
17256
+ * @since 2.2.3
17257
+ */
17258
+ if ( is_numeric( $current_blog_id ) ) {
17259
+ $this->switch_to_blog( $current_blog_id );
17260
+ }
17261
+
17262
  $result = $this->send_install_update( array(), true );
17263
  $is_valid = $this->is_api_result_entity( $result );
17264
  } else {
17527
  'trial_promotion',
17528
  'trial_expired',
17529
  'activation_complete',
17530
+ 'license_expired',
17531
  ) );
17532
  break;
17533
  case 'changed':
17768
  $api = $this->get_api_site_scope();
17769
  $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' );
17770
 
17771
+ $this->handle_license_deactivation_result( $license, $hmm_text, $show_notice );
17772
+ }
17773
+
17774
+ /**
17775
+ * @author Leo Fajardo (@leorw)
17776
+ * @since 2.2.1
17777
+ *
17778
+ * @param FS_Plugin_License $license
17779
+ * @param bool|string $hmm_text
17780
+ * @param bool $show_notice
17781
+ */
17782
+ private function handle_license_deactivation_result( $license, $hmm_text = false, $show_notice = true ) {
17783
  if ( isset( $license->error ) ) {
17784
  $this->_admin_notices->add(
17785
  $this->get_text_inline( 'It looks like the license deactivation failed.', 'license-deactivation-failed-message' ) . '<br> ' .
17800
  }
17801
  }
17802
 
17803
+ // Update site plan to default.
17804
  $this->_sync_plans();
17805
  $this->_site->plan_id = $this->_plans[0]->id;
17806
  // Unlink license from site.
17827
  * @author Vova Feldman (@svovaf)
17828
  * @since 1.0.4
17829
  *
17830
+ * @return object
17831
+ *
17832
  * @uses FS_Api
17833
  */
17834
  private function _downgrade_site() {
17835
  $this->_logger->entrance();
17836
 
17837
+ $deactivate_license = fs_request_get_bool( 'deactivate_license' );
17838
+
17839
  $api = $this->get_api_site_scope();
17840
+ $site = $api->call( 'downgrade.json', 'put', array( 'deactivate_license' => $deactivate_license ) );
17841
 
17842
  $plan_downgraded = false;
17843
  $plan = false;
17855
  ( is_object( $subscription ) && ! isset( $subscription->error ) && ! $subscription->is_active() );
17856
  } else {
17857
  // handle different error cases.
17858
+ $this->handle_license_deactivation_result(
17859
+ $site,
17860
+ $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...'
17861
+ );
17862
  }
17863
 
17864
+ if ( ! $plan_downgraded ) {
17865
+ return (object) array(
17866
+ 'error' => (object) array(
17867
+ 'message' => $this->get_text_inline( 'Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes.', 'subscription-cancellation-failure-message' )
 
 
 
 
17868
  )
17869
  );
17870
+ }
17871
 
17872
+ // Remove previous sticky message about upgrade (if exist).
17873
+ $this->_admin_notices->remove_sticky( 'plan_upgraded' );
17874
+
17875
+ $this->_admin_notices->add(
17876
+ sprintf( $this->get_text_inline( 'Your subscription was successfully cancelled. Your %s plan license will expire in %s.', 'plan-x-downgraded-message' ),
17877
+ $plan->title,
17878
+ human_time_diff( time(), strtotime( $this->_license->expiration ) )
17879
+ )
17880
+ );
17881
+
17882
+ // Store site updates.
17883
+ $this->_store_site();
17884
+
17885
+ if ( $deactivate_license &&
17886
+ ! FS_Plugin_License::is_valid_id( $site->license_id )
17887
+ ) {
17888
+ if ( $this->_site->is_localhost() ) {
17889
+ $this->_license->activated_local = max( 0, $this->_license->activated_local - 1 );
17890
+ } else {
17891
+ $this->_license->activated = max( 0, $this->_license->activated - 1 );
17892
+ }
17893
+
17894
+ // Handle successful license deactivation result.
17895
+ $this->handle_license_deactivation_result( $this->_license );
17896
  }
17897
+
17898
+ return $site;
17899
  }
17900
 
17901
  /**
18002
  * @author Vova Feldman (@svovaf)
18003
  * @since 1.0.9
18004
  *
18005
+ * @return object
18006
+ *
18007
  * @uses FS_Api
18008
  */
18009
  private function _cancel_trial() {
18010
  $this->_logger->entrance();
18011
 
 
 
 
18012
  if ( ! $this->is_trial() ) {
18013
+ return (object) array(
18014
+ 'error' => (object) array(
18015
+ 'message' => $this->get_text_inline( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'trial-cancel-no-trial-message' )
18016
+ )
18017
  );
 
 
18018
  }
18019
 
18020
  $trial_plan = $this->get_trial_plan();
18045
  // @todo handle different error cases.
18046
  }
18047
 
18048
+ if ( ! $trial_cancelled ) {
18049
+ return (object) array(
18050
+ 'error' => (object) array(
18051
+ 'message' => $this->get_text_inline( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'trial-cancel-failure-message' )
18052
+ )
18053
+ );
18054
+ }
18055
 
18056
+ // Remove previous sticky messages about upgrade or trial (if exist).
18057
+ $this->_admin_notices->remove_sticky( array(
18058
+ 'trial_started',
18059
+ 'trial_promotion',
18060
+ 'plan_upgraded',
18061
+ ) );
18062
 
18063
+ // Store site updates.
18064
+ $this->_store_site();
18065
+
18066
+ if ( ! $this->is_addon() ||
18067
+ ! $this->deactivate_premium_only_addon_without_license( true )
18068
+ ) {
 
 
18069
  $this->_admin_notices->add(
18070
+ sprintf( $this->get_text_inline( 'Your %s free trial was successfully cancelled.', 'trial-cancel-message' ), $trial_plan->title )
 
 
18071
  );
18072
  }
18073
+
18074
+ return $site;
18075
  }
18076
 
18077
  /**
18095
  * @return bool
18096
  */
18097
  private function _can_download_premium() {
18098
+ return $this->has_any_active_valid_license() ||
18099
  ( $this->is_trial() && ! $this->get_trial_plan()->is_free() );
18100
  }
18101
 
18115
 
18116
  $is_premium = null;
18117
  if ( ! $is_addon ) {
18118
+ $is_premium = ( $this->is_premium() || $this->_can_download_premium() );
18119
  } else if ( $this->is_addon_activated( $addon_id ) ) {
18120
+ $fs_addon = self::get_instance_by_id( $addon_id );
18121
+ $is_premium = ( $fs_addon->is_premium() || $fs_addon->_can_download_premium() );
18122
  }
18123
 
18124
  // If add-on, then append add-on ID.
18142
  * @since 1.0.4
18143
  *
18144
  * @param bool|number $addon_id
18145
+ * @param bool $flush Since 1.1.7.3
18146
+ * @param int $expiration Since 1.2.2.7
18147
+ * @param bool|string $newer_than Since 2.2.1
18148
+ * @param bool|string $fetch_readme Since 2.2.1
18149
  *
18150
  * @return object|false Plugin latest tag info.
18151
  */
18152
  function _fetch_latest_version(
18153
  $addon_id = false,
18154
  $flush = true,
18155
+ $expiration = WP_FS__TIME_24_HOURS_IN_SEC,
18156
+ $newer_than = false,
18157
+ $fetch_readme = true
18158
  ) {
18159
  $this->_logger->entrance();
18160
 
18205
  $this->switch_to_blog( $switch_to_blog_id );
18206
  }
18207
 
18208
+ $latest_version_endpoint = $this->_get_latest_version_endpoint( $addon_id, 'json' );
18209
+
18210
+ if ( ! empty( $newer_than ) ) {
18211
+ $latest_version_endpoint = add_query_arg( 'newer_than', $newer_than, $latest_version_endpoint );
18212
+ }
18213
+
18214
+ if ( true === $fetch_readme ) {
18215
+ $latest_version_endpoint = add_query_arg( 'readme', 'true', $latest_version_endpoint );
18216
+ }
18217
+
18218
  $tag = $this->get_api_site_or_plugin_scope()->get(
18219
+ $latest_version_endpoint,
18220
  $flush,
18221
  $expiration
18222
  );
18328
 
18329
  if ( ! empty( $plugin_id ) ) {
18330
  $params['plugin_id'] = $plugin_id;
18331
+ } else if ( $this->is_addon() ) {
18332
+ $params['plugin_id'] = $this->get_id();
18333
  }
18334
 
18335
+ $fs = $this->is_addon() ?
18336
+ $this->get_parent_instance() :
18337
+ $this;
18338
+
18339
+ return $fs->get_account_url( 'download_latest', $params );
18340
  }
18341
 
18342
  #endregion Download Plugin ------------------------------------------------------------------
18352
  * @param bool|number $plugin_id
18353
  * @param bool $flush Since 1.1.7.3
18354
  * @param int $expiration Since 1.2.2.7
18355
+ * @param bool|string $newer_than Since 2.2.1
18356
  */
18357
  private function check_updates(
18358
  $background = false,
18359
  $plugin_id = false,
18360
  $flush = true,
18361
+ $expiration = WP_FS__TIME_24_HOURS_IN_SEC,
18362
+ $newer_than = false
18363
  ) {
18364
  $this->_logger->entrance();
18365
 
18366
  // Check if there's a newer version for download.
18367
+ $new_version = $this->_fetch_newer_version( $plugin_id, $flush, $expiration, $newer_than );
18368
 
18369
  $update = null;
18370
  if ( is_object( $new_version ) ) {
18414
 
18415
  $api = $this->get_api_site_or_plugin_scope();
18416
 
18417
+ $path = $this->add_show_pending( '/addons.json?enriched=true' );
18418
+
18419
  /**
18420
  * @since 1.2.1
18421
  *
18422
  * If there's a cached version of the add-ons and not asking
18423
  * for a flush, just use the currently stored add-ons.
18424
  */
18425
+ if ( ! $flush && $api->is_cached( $path ) ) {
18426
  $addons = self::get_all_addons();
18427
 
18428
  return $addons[ $this->_plugin->id ];
18429
  }
18430
 
18431
+ $result = $api->get( $path, $flush );
18432
 
18433
  $addons = array();
18434
  if ( $this->is_api_result_object( $result, 'plugins' ) &&
18720
  */
18721
  function get_after_activation_url( $filter, $params = array(), $network = null ) {
18722
  if ( $this->is_free_wp_org_theme() &&
18723
+ ( fs_request_has( 'pending_activation' ) ||
18724
+ // For cases when the first time path is set, even though it's a WP.org theme.
18725
+ fs_request_get_bool( $this->get_unique_affix() . '_show_optin' ) )
18726
  ) {
18727
  $first_time_path = '';
18728
  } else {
18854
  $this->_site = null;
18855
  $this->_user = null;
18856
 
18857
+ $this->maybe_set_slug_and_network_menu_exists_flag();
18858
+
18859
  fs_redirect( $this->get_activation_url() );
18860
  } else {
18861
  if ( $this->is_addon_activated( $plugin_id ) ) {
18875
  check_admin_referer( $action );
18876
  }
18877
 
18878
+ $switch_to_network_install_blog_after_cancellation = (
18879
+ is_numeric( $blog_id ) &&
18880
+ $plugin_id == $this->get_id() &&
18881
+ ! $this->is_trial()
18882
+ );
18883
 
18884
+ $result = $this->cancel_subscription_or_trial( $plugin_id );
18885
+ if ( $this->is_api_error( $result ) ) {
18886
+ $this->_admin_notices->add(
18887
+ $result->error->message,
18888
+ $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
18889
+ 'error'
18890
+ );
18891
+ }
18892
+
18893
+ if ( $switch_to_network_install_blog_after_cancellation ) {
18894
+ $this->switch_to_blog( $this->_storage->network_install_blog_id );
18895
  }
18896
 
18897
  return;
18923
  $this->_site = null;
18924
  $this->_user = null;
18925
 
18926
+ if ( ! $is_network_action ) {
18927
+ fs_redirect( $this->get_activation_url() );
18928
+ } else if ( is_numeric( $blog_id ) ) {
18929
+ $this->switch_to_blog( $this->_storage->network_install_blog_id );
18930
+ }
18931
  }
18932
  } else {
18933
  if ( $this->is_addon_activated( $plugin_id ) ) {
19025
  #region Actions that might be called from external links (e.g. email)
19026
 
19027
  case 'cancel_trial':
19028
+ $result = $this->cancel_subscription_or_trial( $plugin_id );
19029
+ if ( $this->is_api_error( $result ) ) {
19030
+ $this->_admin_notices->add(
19031
+ $result->error->message,
19032
+ $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
19033
+ 'error'
19034
+ );
19035
  }
19036
 
19037
  return;
19260
  $vars = array( 'id' => $this->_module_id );
19261
 
19262
  if ( 'true' === fs_request_get( 'checkout', false ) ) {
19263
+ echo $this->apply_filters( 'templates/checkout.php', fs_get_template( 'checkout.php', $vars ) );
19264
  } else {
19265
+ echo $this->apply_filters( 'templates/pricing.php', fs_get_template( 'pricing.php', $vars ) );
19266
  }
19267
  }
19268
 
19280
  $this->_logger->entrance();
19281
 
19282
  $vars = array( 'id' => $this->_module_id );
19283
+
19284
+ /**
19285
+ * Added filter to the template to allow developers wrapping the template
19286
+ * in custom HTML (e.g. within a wizard/tabs).
19287
+ *
19288
+ * @author Vova Feldman (@svovaf)
19289
+ * @since 2.1.3
19290
+ */
19291
+ echo $this->apply_filters( 'templates/contact.php', fs_get_template( 'contact.php', $vars ) );
19292
  }
19293
 
19294
  #endregion ------------------------------------------------------------------------
19385
  * @return FS_Api
19386
  */
19387
  private function get_current_or_network_user_api_scope( $flush = false ) {
19388
+ if ( ! $this->_is_network_active ||
19389
+ ( isset( $this->_user ) && $this->_user instanceof FS_User )
19390
+ ) {
19391
  return $this->get_api_user_scope( $flush );
19392
  }
19393
 
19475
  * @author Vova Feldman (@svovaf)
19476
  * @since 1.0.9
19477
  *
19478
+ * @param FS_Plugin_Plan[] $plans
19479
  */
19480
  function _check_for_trial_plans( $plans ) {
19481
+ /**
19482
+ * For some reason core's do_action() flattens arrays when it has a single object item. Therefore, we need to restructure the array as expected.
19483
+ *
19484
+ * @author Vova Feldman (@svovaf)
19485
+ * @since 2.1.2
19486
+ */
19487
+ if ( ! is_array( $plans ) && is_object( $plans ) ) {
19488
+ $plans = array( $plans );
19489
+ }
19490
+
19491
  $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan( $plans );
19492
  }
19493
 
19594
 
19595
  // Show promotion if never shown before and 24 hours after initial activation with FS.
19596
  if ( ! $was_promotion_shown_before &&
19597
+ $this->_storage->install_timestamp > ( time() - $this->apply_filters( 'show_first_trial_after_n_sec', WP_FS__TIME_24_HOURS_IN_SEC ) )
19598
  ) {
19599
  return false;
19600
  }
19601
 
19602
  // OR if promotion was shown before, try showing it every 30 days.
19603
  if ( $was_promotion_shown_before &&
19604
+ $this->apply_filters( 'reshow_trial_after_every_n_sec', 30 * WP_FS__TIME_24_HOURS_IN_SEC ) > time() - $last_time_trial_promotion_shown
19605
  ) {
19606
  return false;
19607
  }
20027
 
20028
  if ( ! $this->is_addon() || ! $this->has_free_plan() ) {
20029
  $first_time_path = $this->_menu->get_first_time_path();
20030
+
20031
+ if ( $this->is_activation_mode() ) {
20032
+ $url = $this->get_activation_url();
20033
+ } else if ( ! empty( $first_time_path ) ) {
20034
+ $url = $first_time_path;
20035
+ } else {
20036
+ $page = '';
20037
+ if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
20038
+ if ( $this->is_network_registered() ) {
20039
+ $page = 'account';
20040
+ } else if ( $this->is_network_anonymous() ) {
20041
+ $this->maybe_set_slug_and_network_menu_exists_flag();
20042
+ }
20043
+ }
20044
+
20045
+ $url = $this->_get_admin_page_url( $page );
20046
+ }
20047
  } else {
20048
  $plugin_fs = false;
20049
 
20163
  $this->_admin_notices->add_sticky( $message, $id, $title, $type );
20164
  }
20165
 
20166
+ /**
20167
+ * Check if the paid version of the module is installed.
20168
+ *
20169
+ * @author Vova Feldman (@svovaf)
20170
+ * @since 2.2.0
20171
+ *
20172
+ * @return bool
20173
+ */
20174
+ private function is_premium_version_installed() {
20175
+ $premium_plugin_basename = $this->premium_plugin_basename();
20176
+ $premium_plugin = get_plugins( '/' . dirname( $premium_plugin_basename ) );
20177
+
20178
+ return ! empty( $premium_plugin );
20179
+ }
20180
+
20181
  /**
20182
  * Helper function that returns the final steps for the upgrade completion.
20183
  *
20203
  $plan_title = $this->get_plan_title();
20204
  }
20205
 
20206
+ if ( $this->is_premium_version_installed() ) {
20207
+ /**
20208
+ * If the premium version is already installed, instead of showing the installation instructions,
20209
+ * tell the current user to activate it.
20210
+ *
20211
+ * @author Leo Fajardo (@leorw)
20212
+ * @since 2.2.1
20213
+ */
20214
+ $premium_plugin_basename = $this->premium_plugin_basename();
20215
 
20216
+ return sprintf(
20217
+ /* translators: %1s: Product title; %2s: Plan title */
20218
+ $this->get_text_inline( ' The paid version of %1s is already installed. Please activate it to start benefiting the %2s features. %3s', 'activate-premium-version' ),
20219
+ sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
20220
+ $plan_title,
20221
+ sprintf(
20222
+ '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
20223
+ wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_plugin_basename, 'activate-plugin_' . $premium_plugin_basename ),
20224
+ esc_html( sprintf(
20225
+ /* translators: %s: Plan title */
20226
+ $this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
20227
+ $plan_title
20228
+ ) )
20229
+ )
20230
+ );
20231
+ } else {
20232
+ // @since 1.2.1.5 The free version is auto deactivated.
20233
+ $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
20234
+ ( '<li>' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.</li>' ) :
20235
+ '';
20236
+
20237
+ return sprintf(
20238
+ ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
20239
+ $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
20240
+ ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
20241
+ $this->get_latest_download_link( sprintf(
20242
+ /* translators: %s: Plan title */
20243
+ $this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ),
20244
+ $plan_title
20245
+ ) ),
20246
+ $deactivation_step,
20247
+ $this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ),
20248
+ '//bit.ly/upload-wp-' . $this->_module_type . 's',
20249
+ $this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' )
20250
+ );
20251
+ }
20252
  }
20253
 
20254
  /**
20280
  * @param array $request
20281
  * @param int $success_cache_expiration
20282
  * @param int $failure_cache_expiration
20283
+ * @param bool $maybe_enrich_request_for_debug
20284
  *
20285
  * @return WP_Error|array
20286
  */
20287
+ static function safe_remote_post(
20288
  &$url,
20289
  $request,
20290
  $success_cache_expiration = 0,
20291
+ $failure_cache_expiration = 0,
20292
+ $maybe_enrich_request_for_debug = true
20293
  ) {
20294
  $should_cache = ($success_cache_expiration + $failure_cache_expiration > 0);
20295
 
20300
  false;
20301
 
20302
  if ( false === $response ) {
20303
+ if ( $maybe_enrich_request_for_debug ) {
20304
+ self::enrich_request_for_debug( $url, $request );
20305
+ }
20306
 
20307
  $response = wp_remote_post( $url, $request );
20308
 
21031
 
21032
  // Locate the main assets folder.
21033
  if ( 1 < count( $fs_active_plugins->plugins ) ) {
21034
+ $plugin_or_theme_img_dir = ( $this->is_plugin() ? WP_PLUGIN_DIR : get_theme_root( get_stylesheet() ) );
21035
 
21036
  foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
21037
  if ( $data->plugin_path == $this->get_plugin_basename() ) {
21038
  $img_dir = $plugin_or_theme_img_dir
21039
  . '/'
21040
+ /**
21041
+ * The basename will be `themes` or the basename of a custom themes directory.
21042
+ *
21043
+ * @author Leo Fajardo (@leorw)
21044
+ * @since 2.2.3
21045
+ */
21046
+ . str_replace( '../' . basename( $plugin_or_theme_img_dir ) . '/', '', $sdk_path )
21047
  . '/assets/img';
21048
 
21049
  break;
21063
  $icon_found = false;
21064
  $local_path = fs_normalize_path( "{$img_dir}/{$this->_slug}.png" );
21065
 
21066
+ if ( ! function_exists( 'get_filesystem_method' ) ) {
21067
+ require_once ABSPATH . 'wp-admin/includes/file.php';
21068
+ }
21069
+
21070
  $have_write_permissions = ( 'direct' === get_filesystem_method( array(), fs_normalize_path( $img_dir ) ) );
21071
 
21072
  /**
21583
  * @since 2.1.0
21584
  */
21585
  function _maybe_add_gdpr_optin_ajax_handler() {
21586
+ $this->add_ajax_action( 'fetch_is_marketing_required_flag_value', array( &$this, '_fetch_is_marketing_required_flag_value_ajax_action' ) );
 
 
21587
 
21588
  if ( FS_GDPR_Manager::instance()->is_opt_in_notice_shown() ) {
21589
  $this->add_gdpr_optin_ajax_handler_and_style();
21767
  }
21768
 
21769
  #endregion
21770
+
21771
+ #----------------------------------------------------------------------------------
21772
+ #region Helper
21773
+ #----------------------------------------------------------------------------------
21774
+
21775
+ /**
21776
+ * If running with a secret key, assume it's the developer and show pending plans as well.
21777
+ *
21778
+ * @author Vova Feldman (@svovaf)
21779
+ * @since 2.1.2
21780
+ *
21781
+ * @param string $path
21782
+ *
21783
+ * @return string
21784
+ */
21785
+ function add_show_pending( $path ) {
21786
+ if ( ! $this->has_secret_key() ) {
21787
+ return $path;
21788
+ }
21789
+
21790
+ return $path . ( false !== strpos( $path, '?' ) ? '&' : '?' ) . 'show_pending=true';
21791
+ }
21792
+
21793
+ #endregion
21794
  }
includes/pum-sdk/freemius/includes/class-fs-admin-notices.php CHANGED
@@ -1,321 +1,321 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 2.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * WP Admin notices manager both for site level and network level.
15
- *
16
- * Class FS_Admin_Notices
17
- */
18
- class FS_Admin_Notices {
19
- /**
20
- * @since 1.2.2
21
- *
22
- * @var string
23
- */
24
- protected $_module_unique_affix;
25
- /**
26
- * @var string
27
- */
28
- protected $_id;
29
- /**
30
- * @var string
31
- */
32
- protected $_title;
33
- /**
34
- * @var FS_Admin_Notice_Manager
35
- */
36
- protected $_notices;
37
- /**
38
- * @var FS_Admin_Notice_Manager
39
- */
40
- protected $_network_notices;
41
- /**
42
- * @var int The ID of the blog that is associated with the current site level options.
43
- */
44
- private $_blog_id = 0;
45
- /**
46
- * @var bool
47
- */
48
- private $_is_multisite;
49
- /**
50
- * @var FS_Admin_Notices[]
51
- */
52
- private static $_instances = array();
53
-
54
- /**
55
- * @param string $id
56
- * @param string $title
57
- * @param string $module_unique_affix
58
- * @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
59
- * blog admin pages.
60
- *
61
- * @return FS_Admin_Notices
62
- */
63
- static function instance( $id, $title = '', $module_unique_affix = '', $is_network_and_blog_admins = false ) {
64
- if ( ! isset( self::$_instances[ $id ] ) ) {
65
- self::$_instances[ $id ] = new FS_Admin_Notices( $id, $title, $module_unique_affix, $is_network_and_blog_admins );
66
- }
67
-
68
- return self::$_instances[ $id ];
69
- }
70
-
71
- /**
72
- * @param string $id
73
- * @param string $title
74
- * @param string $module_unique_affix
75
- * @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
76
- * blog admin pages.
77
- */
78
- protected function __construct( $id, $title = '', $module_unique_affix = '', $is_network_and_blog_admins = false ) {
79
- $this->_id = $id;
80
- $this->_title = $title;
81
- $this->_module_unique_affix = $module_unique_affix;
82
- $this->_is_multisite = is_multisite();
83
-
84
- if ( $this->_is_multisite ) {
85
- $this->_blog_id = get_current_blog_id();
86
-
87
- $this->_network_notices = FS_Admin_Notice_Manager::instance(
88
- $id,
89
- $title,
90
- $module_unique_affix,
91
- $is_network_and_blog_admins,
92
- true
93
- );
94
- }
95
-
96
- $this->_notices = FS_Admin_Notice_Manager::instance(
97
- $id,
98
- $title,
99
- $module_unique_affix,
100
- false,
101
- $this->_blog_id
102
- );
103
- }
104
-
105
- /**
106
- * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
107
- *
108
- * @author Vova Feldman (@svovaf)
109
- * @since 1.0.4
110
- *
111
- * @param string $message
112
- * @param string $title
113
- * @param string $type
114
- * @param bool $is_sticky
115
- * @param string $id Message ID
116
- * @param bool $store_if_sticky
117
- * @param int|null $network_level_or_blog_id
118
- *
119
- * @uses add_action()
120
- */
121
- function add(
122
- $message,
123
- $title = '',
124
- $type = 'success',
125
- $is_sticky = false,
126
- $id = '',
127
- $store_if_sticky = true,
128
- $network_level_or_blog_id = null
129
- ) {
130
- if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
131
- $notices = $this->_network_notices;
132
- } else {
133
- $notices = $this->get_site_notices( $network_level_or_blog_id );
134
- }
135
-
136
- $notices->add(
137
- $message,
138
- $title,
139
- $type,
140
- $is_sticky,
141
- $id,
142
- $store_if_sticky
143
- );
144
- }
145
-
146
- /**
147
- * @author Vova Feldman (@svovaf)
148
- * @since 1.0.7
149
- *
150
- * @param string|string[] $ids
151
- * @param int|null $network_level_or_blog_id
152
- */
153
- function remove_sticky( $ids, $network_level_or_blog_id = null ) {
154
- if ( ! is_array( $ids ) ) {
155
- $ids = array( $ids );
156
- }
157
-
158
- if ( $this->should_use_network_notices( $ids[0], $network_level_or_blog_id ) ) {
159
- $notices = $this->_network_notices;
160
- } else {
161
- $notices = $this->get_site_notices( $network_level_or_blog_id );
162
- }
163
-
164
- return $notices->remove_sticky( $ids );
165
- }
166
-
167
- /**
168
- * Check if sticky message exists by id.
169
- *
170
- * @author Vova Feldman (@svovaf)
171
- * @since 1.0.9
172
- *
173
- * @param string $id
174
- * @param int|null $network_level_or_blog_id
175
- *
176
- * @return bool
177
- */
178
- function has_sticky( $id, $network_level_or_blog_id = null ) {
179
- if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
180
- $notices = $this->_network_notices;
181
- } else {
182
- $notices = $this->get_site_notices( $network_level_or_blog_id );
183
- }
184
-
185
- return $notices->has_sticky( $id );
186
- }
187
-
188
- /**
189
- * Adds sticky admin notification.
190
- *
191
- * @author Vova Feldman (@svovaf)
192
- * @since 1.0.7
193
- *
194
- * @param string $message
195
- * @param string $id Message ID
196
- * @param string $title
197
- * @param string $type
198
- * @param int|null $network_level_or_blog_id
199
- * @param number|null $wp_user_id
200
- * @param string|null $plugin_title
201
- * @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
202
- * blog admin pages.
203
- */
204
- function add_sticky(
205
- $message,
206
- $id,
207
- $title = '',
208
- $type = 'success',
209
- $network_level_or_blog_id = null,
210
- $wp_user_id = null,
211
- $plugin_title = null,
212
- $is_network_and_blog_admins = false
213
- ) {
214
- if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
215
- $notices = $this->_network_notices;
216
- } else {
217
- $notices = $this->get_site_notices( $network_level_or_blog_id );
218
- }
219
-
220
- $notices->add_sticky( $message, $id, $title, $type, $wp_user_id, $plugin_title, $is_network_and_blog_admins );
221
- }
222
-
223
- /**
224
- * Clear all sticky messages.
225
- *
226
- * @author Vova Feldman (@svovaf)
227
- * @since 2.0.0
228
- *
229
- * @param int|null $network_level_or_blog_id
230
- */
231
- function clear_all_sticky( $network_level_or_blog_id = null ) {
232
- if ( ! $this->_is_multisite ||
233
- false === $network_level_or_blog_id ||
234
- 0 == $network_level_or_blog_id ||
235
- is_null( $network_level_or_blog_id )
236
- ) {
237
- $notices = $this->get_site_notices( $network_level_or_blog_id );
238
- $notices->clear_all_sticky();
239
- }
240
-
241
- if ( $this->_is_multisite &&
242
- ( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
243
- ) {
244
- $this->_network_notices->clear_all_sticky();
245
- }
246
- }
247
-
248
- /**
249
- * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
250
- *
251
- * @author Vova Feldman (@svovaf)
252
- * @since 1.0.4
253
- *
254
- * @param string $message
255
- * @param string $title
256
- * @param string $type
257
- * @param bool $is_sticky
258
- * @param string $id Message ID
259
- */
260
- function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
261
- $this->add( $message, $title, $type, $is_sticky, true, $id );
262
- }
263
-
264
- #--------------------------------------------------------------------------------
265
- #region Helper Methods
266
- #--------------------------------------------------------------------------------
267
-
268
- /**
269
- * @author Vova Feldman (@svovaf)
270
- * @since 2.0.0
271
- *
272
- * @param int $blog_id
273
- *
274
- * @return FS_Admin_Notice_Manager
275
- */
276
- private function get_site_notices( $blog_id = 0 ) {
277
- if ( 0 == $blog_id || $blog_id == $this->_blog_id ) {
278
- return $this->_notices;
279
- }
280
-
281
- return FS_Admin_Notice_Manager::instance(
282
- $this->_id,
283
- $this->_title,
284
- $this->_module_unique_affix,
285
- false,
286
- $blog_id
287
- );
288
- }
289
-
290
- /**
291
- * Check if the network notices should be used.
292
- *
293
- * @author Vova Feldman (@svovaf)
294
- * @since 2.0.0
295
- *
296
- * @param string $id
297
- * @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite notices (if there's a network). When `false`, use the current context blog notices. When `null`, the decision which notices manager to use (MS vs. Current S) will be handled internally and determined based on the $id and the context admin (blog admin vs. network level admin).
298
- *
299
- * @return bool
300
- */
301
- private function should_use_network_notices( $id = '', $network_level_or_blog_id = null ) {
302
- if ( ! $this->_is_multisite ) {
303
- // Not a multisite environment.
304
- return false;
305
- }
306
-
307
- if ( is_numeric( $network_level_or_blog_id ) ) {
308
- // Explicitly asked to use a specified blog storage.
309
- return false;
310
- }
311
-
312
- if ( is_bool( $network_level_or_blog_id ) ) {
313
- // Explicitly specified whether should use the network or blog level storage.
314
- return $network_level_or_blog_id;
315
- }
316
-
317
- return fs_is_network_admin();
318
- }
319
-
320
- #endregion
321
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 2.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * WP Admin notices manager both for site level and network level.
15
+ *
16
+ * Class FS_Admin_Notices
17
+ */
18
+ class FS_Admin_Notices {
19
+ /**
20
+ * @since 1.2.2
21
+ *
22
+ * @var string
23
+ */
24
+ protected $_module_unique_affix;
25
+ /**
26
+ * @var string
27
+ */
28
+ protected $_id;
29
+ /**
30
+ * @var string
31
+ */
32
+ protected $_title;
33
+ /**
34
+ * @var FS_Admin_Notice_Manager
35
+ */
36
+ protected $_notices;
37
+ /**
38
+ * @var FS_Admin_Notice_Manager
39
+ */
40
+ protected $_network_notices;
41
+ /**
42
+ * @var int The ID of the blog that is associated with the current site level options.
43
+ */
44
+ private $_blog_id = 0;
45
+ /**
46
+ * @var bool
47
+ */
48
+ private $_is_multisite;
49
+ /**
50
+ * @var FS_Admin_Notices[]
51
+ */
52
+ private static $_instances = array();
53
+
54
+ /**
55
+ * @param string $id
56
+ * @param string $title
57
+ * @param string $module_unique_affix
58
+ * @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
59
+ * blog admin pages.
60
+ *
61
+ * @return FS_Admin_Notices
62
+ */
63
+ static function instance( $id, $title = '', $module_unique_affix = '', $is_network_and_blog_admins = false ) {
64
+ if ( ! isset( self::$_instances[ $id ] ) ) {
65
+ self::$_instances[ $id ] = new FS_Admin_Notices( $id, $title, $module_unique_affix, $is_network_and_blog_admins );
66
+ }
67
+
68
+ return self::$_instances[ $id ];
69
+ }
70
+
71
+ /**
72
+ * @param string $id
73
+ * @param string $title
74
+ * @param string $module_unique_affix
75
+ * @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
76
+ * blog admin pages.
77
+ */
78
+ protected function __construct( $id, $title = '', $module_unique_affix = '', $is_network_and_blog_admins = false ) {
79
+ $this->_id = $id;
80
+ $this->_title = $title;
81
+ $this->_module_unique_affix = $module_unique_affix;
82
+ $this->_is_multisite = is_multisite();
83
+
84
+ if ( $this->_is_multisite ) {
85
+ $this->_blog_id = get_current_blog_id();
86
+
87
+ $this->_network_notices = FS_Admin_Notice_Manager::instance(
88
+ $id,
89
+ $title,
90
+ $module_unique_affix,
91
+ $is_network_and_blog_admins,
92
+ true
93
+ );
94
+ }
95
+
96
+ $this->_notices = FS_Admin_Notice_Manager::instance(
97
+ $id,
98
+ $title,
99
+ $module_unique_affix,
100
+ false,
101
+ $this->_blog_id
102
+ );
103
+ }
104
+
105
+ /**
106
+ * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
107
+ *
108
+ * @author Vova Feldman (@svovaf)
109
+ * @since 1.0.4
110
+ *
111
+ * @param string $message
112
+ * @param string $title
113
+ * @param string $type
114
+ * @param bool $is_sticky
115
+ * @param string $id Message ID
116
+ * @param bool $store_if_sticky
117
+ * @param int|null $network_level_or_blog_id
118
+ *
119
+ * @uses add_action()
120
+ */
121
+ function add(
122
+ $message,
123
+ $title = '',
124
+ $type = 'success',
125
+ $is_sticky = false,
126
+ $id = '',
127
+ $store_if_sticky = true,
128
+ $network_level_or_blog_id = null
129
+ ) {
130
+ if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
131
+ $notices = $this->_network_notices;
132
+ } else {
133
+ $notices = $this->get_site_notices( $network_level_or_blog_id );
134
+ }
135
+
136
+ $notices->add(
137
+ $message,
138
+ $title,
139
+ $type,
140
+ $is_sticky,
141
+ $id,
142
+ $store_if_sticky
143
+ );
144
+ }
145
+
146
+ /**
147
+ * @author Vova Feldman (@svovaf)
148
+ * @since 1.0.7
149
+ *
150
+ * @param string|string[] $ids
151
+ * @param int|null $network_level_or_blog_id
152
+ */
153
+ function remove_sticky( $ids, $network_level_or_blog_id = null ) {
154
+ if ( ! is_array( $ids ) ) {
155
+ $ids = array( $ids );
156
+ }
157
+
158
+ if ( $this->should_use_network_notices( $ids[0], $network_level_or_blog_id ) ) {
159
+ $notices = $this->_network_notices;
160
+ } else {
161
+ $notices = $this->get_site_notices( $network_level_or_blog_id );
162
+ }
163
+
164
+ return $notices->remove_sticky( $ids );
165
+ }
166
+
167
+ /**
168
+ * Check if sticky message exists by id.
169
+ *
170
+ * @author Vova Feldman (@svovaf)
171
+ * @since 1.0.9
172
+ *
173
+ * @param string $id
174
+ * @param int|null $network_level_or_blog_id
175
+ *
176
+ * @return bool
177
+ */
178
+ function has_sticky( $id, $network_level_or_blog_id = null ) {
179
+ if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
180
+ $notices = $this->_network_notices;
181
+ } else {
182
+ $notices = $this->get_site_notices( $network_level_or_blog_id );
183
+ }
184
+
185
+ return $notices->has_sticky( $id );
186
+ }
187
+
188
+ /**
189
+ * Adds sticky admin notification.
190
+ *
191
+ * @author Vova Feldman (@svovaf)
192
+ * @since 1.0.7
193
+ *
194
+ * @param string $message
195
+ * @param string $id Message ID
196
+ * @param string $title
197
+ * @param string $type
198
+ * @param int|null $network_level_or_blog_id
199
+ * @param number|null $wp_user_id
200
+ * @param string|null $plugin_title
201
+ * @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
202
+ * blog admin pages.
203
+ */
204
+ function add_sticky(
205
+ $message,
206
+ $id,
207
+ $title = '',
208
+ $type = 'success',
209
+ $network_level_or_blog_id = null,
210
+ $wp_user_id = null,
211
+ $plugin_title = null,
212
+ $is_network_and_blog_admins = false
213
+ ) {
214
+ if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
215
+ $notices = $this->_network_notices;
216
+ } else {
217
+ $notices = $this->get_site_notices( $network_level_or_blog_id );
218
+ }
219
+
220
+ $notices->add_sticky( $message, $id, $title, $type, $wp_user_id, $plugin_title, $is_network_and_blog_admins );
221
+ }
222
+
223
+ /**
224
+ * Clear all sticky messages.
225
+ *
226
+ * @author Vova Feldman (@svovaf)
227
+ * @since 2.0.0
228
+ *
229
+ * @param int|null $network_level_or_blog_id
230
+ */
231
+ function clear_all_sticky( $network_level_or_blog_id = null ) {
232
+ if ( ! $this->_is_multisite ||
233
+ false === $network_level_or_blog_id ||
234
+ 0 == $network_level_or_blog_id ||
235
+ is_null( $network_level_or_blog_id )
236
+ ) {
237
+ $notices = $this->get_site_notices( $network_level_or_blog_id );
238
+ $notices->clear_all_sticky();
239
+ }
240
+
241
+ if ( $this->_is_multisite &&
242
+ ( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
243
+ ) {
244
+ $this->_network_notices->clear_all_sticky();
245
+ }
246
+ }
247
+
248
+ /**
249
+ * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
250
+ *
251
+ * @author Vova Feldman (@svovaf)
252
+ * @since 1.0.4
253
+ *
254
+ * @param string $message
255
+ * @param string $title
256
+ * @param string $type
257
+ * @param bool $is_sticky
258
+ * @param string $id Message ID
259
+ */
260
+ function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
261
+ $this->add( $message, $title, $type, $is_sticky, true, $id );
262
+ }
263
+
264
+ #--------------------------------------------------------------------------------
265
+ #region Helper Methods
266
+ #--------------------------------------------------------------------------------
267
+
268
+ /**
269
+ * @author Vova Feldman (@svovaf)
270
+ * @since 2.0.0
271
+ *
272
+ * @param int $blog_id
273
+ *
274
+ * @return FS_Admin_Notice_Manager
275
+ */
276
+ private function get_site_notices( $blog_id = 0 ) {
277
+ if ( 0 == $blog_id || $blog_id == $this->_blog_id ) {
278
+ return $this->_notices;
279
+ }
280
+
281
+ return FS_Admin_Notice_Manager::instance(
282
+ $this->_id,
283
+ $this->_title,
284
+ $this->_module_unique_affix,
285
+ false,
286
+ $blog_id
287
+ );
288
+ }
289
+
290
+ /**
291
+ * Check if the network notices should be used.
292
+ *
293
+ * @author Vova Feldman (@svovaf)
294
+ * @since 2.0.0
295
+ *
296
+ * @param string $id
297
+ * @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite notices (if there's a network). When `false`, use the current context blog notices. When `null`, the decision which notices manager to use (MS vs. Current S) will be handled internally and determined based on the $id and the context admin (blog admin vs. network level admin).
298
+ *
299
+ * @return bool
300
+ */
301
+ private function should_use_network_notices( $id = '', $network_level_or_blog_id = null ) {
302
+ if ( ! $this->_is_multisite ) {
303
+ // Not a multisite environment.
304
+ return false;
305
+ }
306
+
307
+ if ( is_numeric( $network_level_or_blog_id ) ) {
308
+ // Explicitly asked to use a specified blog storage.
309
+ return false;
310
+ }
311
+
312
+ if ( is_bool( $network_level_or_blog_id ) ) {
313
+ // Explicitly specified whether should use the network or blog level storage.
314
+ return $network_level_or_blog_id;
315
+ }
316
+
317
+ return fs_is_network_admin();
318
+ }
319
+
320
+ #endregion
321
  }
includes/pum-sdk/freemius/includes/class-fs-api.php CHANGED
@@ -238,7 +238,7 @@
238
  if ( ! is_object( $result ) || isset( $result->error ) ) {
239
  // Api returned an error.
240
  if ( is_object( $cached_result ) &&
241
- ! isset( $cached_result )
242
  ) {
243
  // If there was an error during a newer data fetch,
244
  // fallback to older data version.
@@ -248,9 +248,19 @@
248
  $this->_logger->warn( 'Fallback to cached API result: ' . var_export( $cached_result, true ) );
249
  }
250
  } else {
251
- // If no older data version, return result without
252
- // caching the error.
253
- return $result;
 
 
 
 
 
 
 
 
 
 
254
  }
255
  }
256
 
@@ -551,7 +561,7 @@
551
  return (
552
  is_object( $result ) &&
553
  isset( $result->error ) &&
554
- isset( $result->message )
555
  );
556
  }
557
 
238
  if ( ! is_object( $result ) || isset( $result->error ) ) {
239
  // Api returned an error.
240
  if ( is_object( $cached_result ) &&
241
+ ! isset( $cached_result->error )
242
  ) {
243
  // If there was an error during a newer data fetch,
244
  // fallback to older data version.
248
  $this->_logger->warn( 'Fallback to cached API result: ' . var_export( $cached_result, true ) );
249
  }
250
  } else {
251
+ if ( is_object( $result ) && 404 == $result->error->http ) {
252
+ /**
253
+ * If the response code is 404, cache the result for half of the `$expiration`.
254
+ *
255
+ * @author Leo Fajardo (@leorw)
256
+ * @since 2.2.3.1
257
+ */
258
+ $expiration /= 2;
259
+ } else {
260
+ // If no older data version and the response code is not 404, return result without
261
+ // caching the error.
262
+ return $result;
263
+ }
264
  }
265
  }
266
 
561
  return (
562
  is_object( $result ) &&
563
  isset( $result->error ) &&
564
+ isset( $result->error->message )
565
  );
566
  }
567
 
includes/pum-sdk/freemius/includes/class-fs-logger.php CHANGED
@@ -1,691 +1,691 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Logger {
14
- private $_id;
15
- private $_on = false;
16
- private $_echo = false;
17
- private $_file_start = 0;
18
- /**
19
- * @var int PHP Process ID.
20
- */
21
- private static $_processID;
22
- /**
23
- * @var string PHP Script user name.
24
- */
25
- private static $_ownerName;
26
- /**
27
- * @var bool Is storage logging turned on.
28
- */
29
- private static $_isStorageLoggingOn;
30
- /**
31
- * @var int ABSPATH length.
32
- */
33
- private static $_abspathLength;
34
-
35
- private static $LOGGERS = array();
36
- private static $LOG = array();
37
- private static $CNT = 0;
38
- private static $_HOOKED_FOOTER = false;
39
-
40
- private function __construct( $id, $on = false, $echo = false ) {
41
- $this->_id = $id;
42
-
43
- $bt = debug_backtrace();
44
- $caller = $bt[2];
45
-
46
- if ( false !== strpos( $caller['file'], 'plugins' ) ) {
47
- $this->_file_start = strpos( $caller['file'], 'plugins' ) + strlen( 'plugins/' );
48
- } else {
49
- $this->_file_start = strpos( $caller['file'], 'themes' ) + strlen( 'themes/' );
50
- }
51
-
52
- if ( $on ) {
53
- $this->on();
54
- }
55
- if ( $echo ) {
56
- $this->echo_on();
57
- }
58
- }
59
-
60
- /**
61
- * @param string $id
62
- * @param bool $on
63
- * @param bool $echo
64
- *
65
- * @return FS_Logger
66
- */
67
- public static function get_logger( $id, $on = false, $echo = false ) {
68
- $id = strtolower( $id );
69
-
70
- if ( ! isset( self::$_processID ) ) {
71
- self::init();
72
- }
73
-
74
- if ( ! isset( self::$LOGGERS[ $id ] ) ) {
75
- self::$LOGGERS[ $id ] = new FS_Logger( $id, $on, $echo );
76
- }
77
-
78
- return self::$LOGGERS[ $id ];
79
- }
80
-
81
- /**
82
- * Initialize logging global info.
83
- *
84
- * @author Vova Feldman (@svovaf)
85
- * @since 1.2.1.6
86
- */
87
- private static function init() {
88
- self::$_ownerName = function_exists( 'get_current_user' ) ?
89
- get_current_user() :
90
- 'unknown';
91
- self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
92
- self::$_abspathLength = strlen( ABSPATH );
93
- self::$_processID = mt_rand( 0, 32000 );
94
-
95
- // Process ID may be `false` on errors.
96
- if ( ! is_numeric( self::$_processID ) ) {
97
- self::$_processID = 0;
98
- }
99
- }
100
-
101
- private static function hook_footer() {
102
- if ( self::$_HOOKED_FOOTER ) {
103
- return;
104
- }
105
-
106
- if ( is_admin() ) {
107
- add_action( 'admin_footer', 'FS_Logger::dump', 100 );
108
- } else {
109
- add_action( 'wp_footer', 'FS_Logger::dump', 100 );
110
- }
111
- }
112
-
113
- function is_on() {
114
- return $this->_on;
115
- }
116
-
117
- function on() {
118
- $this->_on = true;
119
-
120
- if ( ! function_exists( 'dbDelta' ) ) {
121
- require_once ABSPATH . 'wp-admin/includes/upgrade.php';
122
- }
123
-
124
- self::hook_footer();
125
- }
126
-
127
- function echo_on() {
128
- $this->on();
129
-
130
- $this->_echo = true;
131
- }
132
-
133
- function is_echo_on() {
134
- return $this->_echo;
135
- }
136
-
137
- function get_id() {
138
- return $this->_id;
139
- }
140
-
141
- function get_file() {
142
- return $this->_file_start;
143
- }
144
-
145
- private function _log( &$message, $type = 'log', $wrapper ) {
146
- if ( ! $this->is_on() ) {
147
- return;
148
- }
149
-
150
- $bt = debug_backtrace();
151
- $depth = $wrapper ? 3 : 2;
152
- while ( $depth < count( $bt ) - 1 && 'eval' === $bt[ $depth ]['function'] ) {
153
- $depth ++;
154
- }
155
-
156
- $caller = $bt[ $depth ];
157
-
158
- /**
159
- * Retrieve the correct call file & line number from backtrace
160
- * when logging from a wrapper method.
161
- *
162
- * @author Vova Feldman
163
- * @since 1.2.1.6
164
- */
165
- if ( empty( $caller['line'] ) ) {
166
- $depth --;
167
-
168
- while ( $depth >= 0 ) {
169
- if ( ! empty( $bt[ $depth ]['line'] ) ) {
170
- $caller['line'] = $bt[ $depth ]['line'];
171
- $caller['file'] = $bt[ $depth ]['file'];
172
- break;
173
- }
174
- }
175
- }
176
-
177
- $log = array_merge( $caller, array(
178
- 'cnt' => self::$CNT ++,
179
- 'logger' => $this,
180
- 'timestamp' => microtime( true ),
181
- 'log_type' => $type,
182
- 'msg' => $message,
183
- ) );
184
-
185
- if ( self::$_isStorageLoggingOn ) {
186
- $this->db_log( $type, $message, self::$CNT, $caller );
187
- }
188
-
189
- self::$LOG[] = $log;
190
-
191
- if ( $this->is_echo_on() && ! Freemius::is_ajax() ) {
192
- echo self::format_html( $log ) . "\n";
193
- }
194
- }
195
-
196
- function log( $message, $wrapper = false ) {
197
- $this->_log( $message, 'log', $wrapper );
198
- }
199
-
200
- function info( $message, $wrapper = false ) {
201
- $this->_log( $message, 'info', $wrapper );
202
- }
203
-
204
- function warn( $message, $wrapper = false ) {
205
- $this->_log( $message, 'warn', $wrapper );
206
- }
207
-
208
- function error( $message, $wrapper = false ) {
209
- $this->_log( $message, 'error', $wrapper );
210
- }
211
-
212
- /**
213
- * Log API error.
214
- *
215
- * @author Vova Feldman (@svovaf)
216
- * @since 1.2.1.5
217
- *
218
- * @param mixed $api_result
219
- * @param bool $wrapper
220
- */
221
- function api_error( $api_result, $wrapper = false ) {
222
- $message = '';
223
- if ( is_object( $api_result ) &&
224
- ! empty( $api_result->error ) &&
225
- ! empty( $api_result->error->message )
226
- ) {
227
- $message = $api_result->error->message;
228
- } else if ( is_object( $api_result ) ) {
229
- $message = var_export( $api_result, true );
230
- } else if ( is_string( $api_result ) ) {
231
- $message = $api_result;
232
- } else if ( empty( $api_result ) ) {
233
- $message = 'Empty API result.';
234
- }
235
-
236
- $message = 'API Error: ' . $message;
237
-
238
- $this->_log( $message, 'error', $wrapper );
239
- }
240
-
241
- function entrance( $message = '', $wrapper = false ) {
242
- $msg = 'Entrance' . ( empty( $message ) ? '' : ' > ' ) . $message;
243
-
244
- $this->_log( $msg, 'log', $wrapper );
245
- }
246
-
247
- function departure( $message = '', $wrapper = false ) {
248
- $msg = 'Departure' . ( empty( $message ) ? '' : ' > ' ) . $message;
249
-
250
- $this->_log( $msg, 'log', $wrapper );
251
- }
252
-
253
- #--------------------------------------------------------------------------------
254
- #region Log Formatting
255
- #--------------------------------------------------------------------------------
256
-
257
- private static function format( $log, $show_type = true ) {
258
- return '[' . str_pad( $log['cnt'], strlen( self::$CNT ), '0', STR_PAD_LEFT ) . '] [' . $log['logger']->_id . '] ' . ( $show_type ? '[' . $log['log_type'] . ']' : '' ) . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . ' >> ' . $log['msg'] . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ') ' : '' ) . ' [' . $log['timestamp'] . ']';
259
- }
260
-
261
- private static function format_html( $log ) {
262
- return '<div style="font-size: 13px; font-family: monospace; color: #7da767; padding: 8px 3px; background: #000; border-bottom: 1px solid #555;">[' . $log['cnt'] . '] [' . $log['logger']->_id . '] [' . $log['log_type'] . '] <b><code style="color: #c4b1e0;">' . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . '</code> >> <b style="color: #f59330;">' . esc_html( $log['msg'] ) . '</b></b>' . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ')' : '' ) . ' [' . $log['timestamp'] . ']</div>';
263
- }
264
-
265
- #endregion
266
-
267
- static function dump() {
268
- ?>
269
- <!-- BEGIN: Freemius PHP Console Log -->
270
- <script type="text/javascript">
271
- <?php
272
- foreach ( self::$LOG as $log ) {
273
- echo 'console.' . $log['log_type'] . '(' . json_encode( self::format( $log, false ) ) . ')' . "\n";
274
- }
275
- ?>
276
- </script>
277
- <!-- END: Freemius PHP Console Log -->
278
- <?php
279
- }
280
-
281
- static function get_log() {
282
- return self::$LOG;
283
- }
284
-
285
- #--------------------------------------------------------------------------------
286
- #region Database Logging
287
- #--------------------------------------------------------------------------------
288
-
289
- /**
290
- * @author Vova Feldman (@svovaf)
291
- * @since 1.2.1.6
292
- *
293
- * @return bool
294
- */
295
- public static function is_storage_logging_on() {
296
- if ( ! isset( self::$_isStorageLoggingOn ) ) {
297
- self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
298
- }
299
-
300
- return self::$_isStorageLoggingOn;
301
- }
302
-
303
- /**
304
- * Turns on/off database persistent debugging to capture
305
- * multi-session logs to debug complex flows like
306
- * plugin auto-deactivate on premium version activation.
307
- *
308
- * @todo Check if Theme Check has issues with DB tables for themes.
309
- *
310
- * @author Vova Feldman (@svovaf)
311
- * @since 1.2.1.6
312
- *
313
- * @param bool $is_on
314
- *
315
- * @return bool
316
- */
317
- public static function _set_storage_logging( $is_on = true ) {
318
- global $wpdb;
319
-
320
- $table = "{$wpdb->prefix}fs_logger";
321
-
322
- if ( $is_on ) {
323
- /**
324
- * Create logging table.
325
- *
326
- * NOTE:
327
- * dbDelta must use KEY and not INDEX for indexes.
328
- *
329
- * @link https://core.trac.wordpress.org/ticket/2695
330
- */
331
- $result = $wpdb->query( "CREATE TABLE {$table} (
332
- `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
333
- `process_id` INT UNSIGNED NOT NULL,
334
- `user_name` VARCHAR(64) NOT NULL,
335
- `logger` VARCHAR(128) NOT NULL,
336
- `log_order` INT UNSIGNED NOT NULL,
337
- `type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
338
- `message` TEXT NOT NULL,
339
- `file` VARCHAR(256) NOT NULL,
340
- `line` INT UNSIGNED NOT NULL,
341
- `function` VARCHAR(256) NOT NULL,
342
- `request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
343
- `request_url` VARCHAR(1024) NOT NULL,
344
- `created` DECIMAL(16, 6) NOT NULL,
345
- PRIMARY KEY (`id`),
346
- KEY `process_id` (`process_id` ASC),
347
- KEY `process_logger` (`process_id` ASC, `logger` ASC),
348
- KEY `function` (`function` ASC),
349
- KEY `type` (`type` ASC))" );
350
- } else {
351
- /**
352
- * Drop logging table.
353
- */
354
- $result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
355
- }
356
-
357
- if ( false !== $result ) {
358
- update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
359
- }
360
-
361
- return ( false !== $result );
362
- }
363
-
364
- /**
365
- * @author Vova Feldman (@svovaf)
366
- * @since 1.2.1.6
367
- *
368
- * @param string $type
369
- * @param string $message
370
- * @param int $log_order
371
- * @param array $caller
372
- *
373
- * @return false|int
374
- */
375
- private function db_log(
376
- &$type,
377
- &$message,
378
- &$log_order,
379
- &$caller
380
- ) {
381
- global $wpdb;
382
-
383
- $request_type = 'call';
384
- if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
385
- $request_type = 'cron';
386
- } else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
387
- $request_type = 'ajax';
388
- }
389
-
390
- $request_url = WP_FS__IS_HTTP_REQUEST ?
391
- $_SERVER['REQUEST_URI'] :
392
- '';
393
-
394
- return $wpdb->insert(
395
- "{$wpdb->prefix}fs_logger",
396
- array(
397
- 'process_id' => self::$_processID,
398
- 'user_name' => self::$_ownerName,
399
- 'logger' => $this->_id,
400
- 'log_order' => $log_order,
401
- 'type' => $type,
402
- 'request_type' => $request_type,
403
- 'request_url' => $request_url,
404
- 'message' => $message,
405
- 'file' => isset( $caller['file'] ) ?
406
- substr( $caller['file'], self::$_abspathLength ) :
407
- '',
408
- 'line' => $caller['line'],
409
- 'function' => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
410
- 'created' => microtime( true ),
411
- )
412
- );
413
- }
414
-
415
- /**
416
- * Persistent DB logger columns.
417
- *
418
- * @var array
419
- */
420
- private static $_log_columns = array(
421
- 'id',
422
- 'process_id',
423
- 'user_name',
424
- 'logger',
425
- 'log_order',
426
- 'type',
427
- 'message',
428
- 'file',
429
- 'line',
430
- 'function',
431
- 'request_type',
432
- 'request_url',
433
- 'created',
434
- );
435
-
436
- /**
437
- * Create DB logs query.
438
- *
439
- * @author Vova Feldman (@svovaf)
440
- * @since 1.2.1.6
441
- *
442
- * @param bool $filters
443
- * @param int $limit
444
- * @param int $offset
445
- * @param bool $order
446
- * @param bool $escape_eol
447
- *
448
- * @return string
449
- */
450
- private static function build_db_logs_query(
451
- $filters = false,
452
- $limit = 200,
453
- $offset = 0,
454
- $order = false,
455
- $escape_eol = false
456
- ) {
457
- global $wpdb;
458
-
459
- $select = '*';
460
-
461
- if ( $escape_eol ) {
462
- $select = '';
463
- for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
464
- if ( $i > 0 ) {
465
- $select .= ', ';
466
- }
467
-
468
- if ( 'message' !== self::$_log_columns[ $i ] ) {
469
- $select .= self::$_log_columns[ $i ];
470
- } else {
471
- $select .= 'REPLACE(message , \'\n\', \' \') AS message';
472
- }
473
- }
474
- }
475
-
476
- $query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
477
- if ( is_array( $filters ) ) {
478
- $criteria = array();
479
-
480
- if ( ! empty( $filters['type'] ) && 'all' !== $filters['type'] ) {
481
- $filters['type'] = strtolower( $filters['type'] );
482
-
483
- switch ( $filters['type'] ) {
484
- case 'warn_error':
485
- $criteria[] = array( 'col' => 'type', 'val' => array( 'warn', 'error' ) );
486
- break;
487
- case 'error':
488
- case 'warn':
489
- $criteria[] = array( 'col' => 'type', 'val' => $filters['type'] );
490
- break;
491
- case 'info':
492
- default:
493
- $criteria[] = array( 'col' => 'type', 'val' => array( 'info', 'log' ) );
494
- break;
495
- }
496
- }
497
-
498
- if ( ! empty( $filters['request_type'] ) ) {
499
- $filters['request_type'] = strtolower( $filters['request_type'] );
500
-
501
- if ( in_array( $filters['request_type'], array( 'call', 'ajax', 'cron' ) ) ) {
502
- $criteria[] = array( 'col' => 'request_type', 'val' => $filters['request_type'] );
503
- }
504
- }
505
-
506
- if ( ! empty( $filters['file'] ) ) {
507
- $criteria[] = array(
508
- 'col' => 'file',
509
- 'op' => 'LIKE',
510
- 'val' => '%' . esc_sql( $filters['file'] ),
511
- );
512
- }
513
-
514
- if ( ! empty( $filters['function'] ) ) {
515
- $criteria[] = array(
516
- 'col' => 'function',
517
- 'op' => 'LIKE',
518
- 'val' => '%' . esc_sql( $filters['function'] ),
519
- );
520
- }
521
-
522
- if ( ! empty( $filters['process_id'] ) && is_numeric( $filters['process_id'] ) ) {
523
- $criteria[] = array( 'col' => 'process_id', 'val' => $filters['process_id'] );
524
- }
525
-
526
- if ( ! empty( $filters['logger'] ) ) {
527
- $criteria[] = array(
528
- 'col' => 'logger',
529
- 'op' => 'LIKE',
530
- 'val' => '%' . esc_sql( $filters['logger'] ) . '%',
531
- );
532
- }
533
-
534
- if ( ! empty( $filters['message'] ) ) {
535
- $criteria[] = array(
536
- 'col' => 'message',
537
- 'op' => 'LIKE',
538
- 'val' => '%' . esc_sql( $filters['message'] ) . '%',
539
- );
540
- }
541
-
542
- if ( 0 < count( $criteria ) ) {
543
- $query .= "\nWHERE\n";
544
-
545
- $first = true;
546
- foreach ( $criteria as $c ) {
547
- if ( ! $first ) {
548
- $query .= "AND\n";
549
- }
550
-
551
- if ( is_array( $c['val'] ) ) {
552
- $operator = 'IN';
553
-
554
- for ( $i = 0, $len = count( $c['val'] ); $i < $len; $i ++ ) {
555
- $c['val'][ $i ] = "'" . esc_sql( $c['val'][ $i ] ) . "'";
556
- }
557
-
558
- $val = '(' . implode( ',', $c['val'] ) . ')';
559
- } else {
560
- $operator = ! empty( $c['op'] ) ? $c['op'] : '=';
561
- $val = "'" . esc_sql( $c['val'] ) . "'";
562
- }
563
-
564
- $query .= "`{$c['col']}` {$operator} {$val}\n";
565
-
566
- $first = false;
567
- }
568
- }
569
- }
570
-
571
- if ( ! is_array( $order ) ) {
572
- $order = array(
573
- 'col' => 'id',
574
- 'order' => 'desc'
575
- );
576
- }
577
-
578
- $query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
579
-
580
- return $query;
581
- }
582
-
583
- /**
584
- * Load logs from DB.
585
- *
586
- * @author Vova Feldman (@svovaf)
587
- * @since 1.2.1.6
588
- *
589
- * @param bool $filters
590
- * @param int $limit
591
- * @param int $offset
592
- * @param bool $order
593
- *
594
- * @return object[]|null
595
- */
596
- public static function load_db_logs(
597
- $filters = false,
598
- $limit = 200,
599
- $offset = 0,
600
- $order = false
601
- ) {
602
- global $wpdb;
603
-
604
- $query = self::build_db_logs_query(
605
- $filters,
606
- $limit,
607
- $offset,
608
- $order
609
- );
610
-
611
- return $wpdb->get_results( $query );
612
- }
613
-
614
- /**
615
- * Load logs from DB.
616
- *
617
- * @author Vova Feldman (@svovaf)
618
- * @since 1.2.1.6
619
- *
620
- * @param bool $filters
621
- * @param string $filename
622
- * @param int $limit
623
- * @param int $offset
624
- * @param bool $order
625
- *
626
- * @return false|string File download URL or false on failure.
627
- */
628
- public static function download_db_logs(
629
- $filters = false,
630
- $filename = '',
631
- $limit = 10000,
632
- $offset = 0,
633
- $order = false
634
- ) {
635
- global $wpdb;
636
-
637
- $query = self::build_db_logs_query(
638
- $filters,
639
- $limit,
640
- $offset,
641
- $order,
642
- true
643
- );
644
-
645
- $upload_dir = wp_upload_dir();
646
- if ( empty( $filename ) ) {
647
- $filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
648
- }
649
- $filepath = rtrim( $upload_dir['path'], '/' ) . "/{$filename}";
650
-
651
- $query .= " INTO OUTFILE '{$filepath}' FIELDS TERMINATED BY '\t' ESCAPED BY '\\\\' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
652
-
653
- $columns = '';
654
- for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
655
- if ( $i > 0 ) {
656
- $columns .= ', ';
657
- }
658
-
659
- $columns .= "'" . self::$_log_columns[ $i ] . "'";
660
- }
661
-
662
- $query = "SELECT {$columns} UNION ALL " . $query;
663
-
664
- $result = $wpdb->query( $query );
665
-
666
- if ( false === $result ) {
667
- return false;
668
- }
669
-
670
- return rtrim( $upload_dir['url'], '/' ) . '/' . $filename;
671
- }
672
-
673
- /**
674
- * @author Vova Feldman (@svovaf)
675
- * @since 1.2.1.6
676
- *
677
- * @param string $filename
678
- *
679
- * @return string
680
- */
681
- public static function get_logs_download_url( $filename = '' ) {
682
- $upload_dir = wp_upload_dir();
683
- if ( empty( $filename ) ) {
684
- $filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
685
- }
686
-
687
- return rtrim( $upload_dir['url'], '/' ) . $filename;
688
- }
689
-
690
- #endregion
691
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Logger {
14
+ private $_id;
15
+ private $_on = false;
16
+ private $_echo = false;
17
+ private $_file_start = 0;
18
+ /**
19
+ * @var int PHP Process ID.
20
+ */
21
+ private static $_processID;
22
+ /**
23
+ * @var string PHP Script user name.
24
+ */
25
+ private static $_ownerName;
26
+ /**
27
+ * @var bool Is storage logging turned on.
28
+ */
29
+ private static $_isStorageLoggingOn;
30
+ /**
31
+ * @var int ABSPATH length.
32
+ */
33
+ private static $_abspathLength;
34
+
35
+ private static $LOGGERS = array();
36
+ private static $LOG = array();
37
+ private static $CNT = 0;
38
+ private static $_HOOKED_FOOTER = false;
39
+
40
+ private function __construct( $id, $on = false, $echo = false ) {
41
+ $this->_id = $id;
42
+
43
+ $bt = debug_backtrace();
44
+ $caller = $bt[2];
45
+
46
+ if ( false !== strpos( $caller['file'], 'plugins' ) ) {
47
+ $this->_file_start = strpos( $caller['file'], 'plugins' ) + strlen( 'plugins/' );
48
+ } else {
49
+ $this->_file_start = strpos( $caller['file'], 'themes' ) + strlen( 'themes/' );
50
+ }
51
+
52
+ if ( $on ) {
53
+ $this->on();
54
+ }
55
+ if ( $echo ) {
56
+ $this->echo_on();
57
+ }
58
+ }
59
+
60
+ /**
61
+ * @param string $id
62
+ * @param bool $on
63
+ * @param bool $echo
64
+ *
65
+ * @return FS_Logger
66
+ */
67
+ public static function get_logger( $id, $on = false, $echo = false ) {
68
+ $id = strtolower( $id );
69
+
70
+ if ( ! isset( self::$_processID ) ) {
71
+ self::init();
72
+ }
73
+
74
+ if ( ! isset( self::$LOGGERS[ $id ] ) ) {
75
+ self::$LOGGERS[ $id ] = new FS_Logger( $id, $on, $echo );
76
+ }
77
+
78
+ return self::$LOGGERS[ $id ];
79
+ }
80
+
81
+ /**
82
+ * Initialize logging global info.
83
+ *
84
+ * @author Vova Feldman (@svovaf)
85
+ * @since 1.2.1.6
86
+ */
87
+ private static function init() {
88
+ self::$_ownerName = function_exists( 'get_current_user' ) ?
89
+ get_current_user() :
90
+ 'unknown';
91
+ self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
92
+ self::$_abspathLength = strlen( ABSPATH );
93
+ self::$_processID = mt_rand( 0, 32000 );
94
+
95
+ // Process ID may be `false` on errors.
96
+ if ( ! is_numeric( self::$_processID ) ) {
97
+ self::$_processID = 0;
98
+ }
99
+ }
100
+
101
+ private static function hook_footer() {
102
+ if ( self::$_HOOKED_FOOTER ) {
103
+ return;
104
+ }
105
+
106
+ if ( is_admin() ) {
107
+ add_action( 'admin_footer', 'FS_Logger::dump', 100 );
108
+ } else {
109
+ add_action( 'wp_footer', 'FS_Logger::dump', 100 );
110
+ }
111
+ }
112
+
113
+ function is_on() {
114
+ return $this->_on;
115
+ }
116
+
117
+ function on() {
118
+ $this->_on = true;
119
+
120
+ if ( ! function_exists( 'dbDelta' ) ) {
121
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
122
+ }
123
+
124
+ self::hook_footer();
125
+ }
126
+
127
+ function echo_on() {
128
+ $this->on();
129
+
130
+ $this->_echo = true;
131
+ }
132
+
133
+ function is_echo_on() {
134
+ return $this->_echo;
135
+ }
136
+
137
+ function get_id() {
138
+ return $this->_id;
139
+ }
140
+
141
+ function get_file() {
142
+ return $this->_file_start;
143
+ }
144
+
145
+ private function _log( &$message, $type = 'log', $wrapper ) {
146
+ if ( ! $this->is_on() ) {
147
+ return;
148
+ }
149
+
150
+ $bt = debug_backtrace();
151
+ $depth = $wrapper ? 3 : 2;
152
+ while ( $depth < count( $bt ) - 1 && 'eval' === $bt[ $depth ]['function'] ) {
153
+ $depth ++;
154
+ }
155
+
156
+ $caller = $bt[ $depth ];
157
+
158
+ /**
159
+ * Retrieve the correct call file & line number from backtrace
160
+ * when logging from a wrapper method.
161
+ *
162
+ * @author Vova Feldman
163
+ * @since 1.2.1.6
164
+ */
165
+ if ( empty( $caller['line'] ) ) {
166
+ $depth --;
167
+
168
+ while ( $depth >= 0 ) {
169
+ if ( ! empty( $bt[ $depth ]['line'] ) ) {
170
+ $caller['line'] = $bt[ $depth ]['line'];
171
+ $caller['file'] = $bt[ $depth ]['file'];
172
+ break;
173
+ }
174
+ }
175
+ }
176
+
177
+ $log = array_merge( $caller, array(
178
+ 'cnt' => self::$CNT ++,
179
+ 'logger' => $this,
180
+ 'timestamp' => microtime( true ),
181
+ 'log_type' => $type,
182
+ 'msg' => $message,
183
+ ) );
184
+
185
+ if ( self::$_isStorageLoggingOn ) {
186
+ $this->db_log( $type, $message, self::$CNT, $caller );
187
+ }
188
+
189
+ self::$LOG[] = $log;
190
+
191
+ if ( $this->is_echo_on() && ! Freemius::is_ajax() ) {
192
+ echo self::format_html( $log ) . "\n";
193
+ }
194
+ }
195
+
196
+ function log( $message, $wrapper = false ) {
197
+ $this->_log( $message, 'log', $wrapper );
198
+ }
199
+
200
+ function info( $message, $wrapper = false ) {
201
+ $this->_log( $message, 'info', $wrapper );
202
+ }
203
+
204
+ function warn( $message, $wrapper = false ) {
205
+ $this->_log( $message, 'warn', $wrapper );
206
+ }
207
+
208
+ function error( $message, $wrapper = false ) {
209
+ $this->_log( $message, 'error', $wrapper );
210
+ }
211
+
212
+ /**
213
+ * Log API error.
214
+ *
215
+ * @author Vova Feldman (@svovaf)
216
+ * @since 1.2.1.5
217
+ *
218
+ * @param mixed $api_result
219
+ * @param bool $wrapper
220
+ */
221
+ function api_error( $api_result, $wrapper = false ) {
222
+ $message = '';
223
+ if ( is_object( $api_result ) &&
224
+ ! empty( $api_result->error ) &&
225
+ ! empty( $api_result->error->message )
226
+ ) {
227
+ $message = $api_result->error->message;
228
+ } else if ( is_object( $api_result ) ) {
229
+ $message = var_export( $api_result, true );
230
+ } else if ( is_string( $api_result ) ) {
231
+ $message = $api_result;
232
+ } else if ( empty( $api_result ) ) {
233
+ $message = 'Empty API result.';
234
+ }
235
+
236
+ $message = 'API Error: ' . $message;
237
+
238
+ $this->_log( $message, 'error', $wrapper );
239
+ }
240
+
241
+ function entrance( $message = '', $wrapper = false ) {
242
+ $msg = 'Entrance' . ( empty( $message ) ? '' : ' > ' ) . $message;
243
+
244
+ $this->_log( $msg, 'log', $wrapper );
245
+ }
246
+
247
+ function departure( $message = '', $wrapper = false ) {
248
+ $msg = 'Departure' . ( empty( $message ) ? '' : ' > ' ) . $message;
249
+
250
+ $this->_log( $msg, 'log', $wrapper );
251
+ }
252
+
253
+ #--------------------------------------------------------------------------------
254
+ #region Log Formatting
255
+ #--------------------------------------------------------------------------------
256
+
257
+ private static function format( $log, $show_type = true ) {
258
+ return '[' . str_pad( $log['cnt'], strlen( self::$CNT ), '0', STR_PAD_LEFT ) . '] [' . $log['logger']->_id . '] ' . ( $show_type ? '[' . $log['log_type'] . ']' : '' ) . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . ' >> ' . $log['msg'] . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ') ' : '' ) . ' [' . $log['timestamp'] . ']';
259
+ }
260
+
261
+ private static function format_html( $log ) {
262
+ return '<div style="font-size: 13px; font-family: monospace; color: #7da767; padding: 8px 3px; background: #000; border-bottom: 1px solid #555;">[' . $log['cnt'] . '] [' . $log['logger']->_id . '] [' . $log['log_type'] . '] <b><code style="color: #c4b1e0;">' . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . '</code> >> <b style="color: #f59330;">' . esc_html( $log['msg'] ) . '</b></b>' . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ')' : '' ) . ' [' . $log['timestamp'] . ']</div>';
263
+ }
264
+
265
+ #endregion
266
+
267
+ static function dump() {
268
+ ?>
269
+ <!-- BEGIN: Freemius PHP Console Log -->
270
+ <script type="text/javascript">
271
+ <?php
272
+ foreach ( self::$LOG as $log ) {
273
+ echo 'console.' . $log['log_type'] . '(' . json_encode( self::format( $log, false ) ) . ')' . "\n";
274
+ }
275
+ ?>
276
+ </script>
277
+ <!-- END: Freemius PHP Console Log -->
278
+ <?php
279
+ }
280
+
281
+ static function get_log() {
282
+ return self::$LOG;
283
+ }
284
+
285
+ #--------------------------------------------------------------------------------
286
+ #region Database Logging
287
+ #--------------------------------------------------------------------------------
288
+
289
+ /**
290
+ * @author Vova Feldman (@svovaf)
291
+ * @since 1.2.1.6
292
+ *
293
+ * @return bool
294
+ */
295
+ public static function is_storage_logging_on() {
296
+ if ( ! isset( self::$_isStorageLoggingOn ) ) {
297
+ self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
298
+ }
299
+
300
+ return self::$_isStorageLoggingOn;
301
+ }
302
+
303
+ /**
304
+ * Turns on/off database persistent debugging to capture
305
+ * multi-session logs to debug complex flows like
306
+ * plugin auto-deactivate on premium version activation.
307
+ *
308
+ * @todo Check if Theme Check has issues with DB tables for themes.
309
+ *
310
+ * @author Vova Feldman (@svovaf)
311
+ * @since 1.2.1.6
312
+ *
313
+ * @param bool $is_on
314
+ *
315
+ * @return bool
316
+ */
317
+ public static function _set_storage_logging( $is_on = true ) {
318
+ global $wpdb;
319
+
320
+ $table = "{$wpdb->prefix}fs_logger";
321
+
322
+ if ( $is_on ) {
323
+ /**
324
+ * Create logging table.
325
+ *
326
+ * NOTE:
327
+ * dbDelta must use KEY and not INDEX for indexes.
328
+ *
329
+ * @link https://core.trac.wordpress.org/ticket/2695
330
+ */
331
+ $result = $wpdb->query( "CREATE TABLE {$table} (
332
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
333
+ `process_id` INT UNSIGNED NOT NULL,
334
+ `user_name` VARCHAR(64) NOT NULL,
335
+ `logger` VARCHAR(128) NOT NULL,
336
+ `log_order` INT UNSIGNED NOT NULL,
337
+ `type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
338
+ `message` TEXT NOT NULL,
339
+ `file` VARCHAR(256) NOT NULL,
340
+ `line` INT UNSIGNED NOT NULL,
341
+ `function` VARCHAR(256) NOT NULL,
342
+ `request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
343
+ `request_url` VARCHAR(1024) NOT NULL,
344
+ `created` DECIMAL(16, 6) NOT NULL,
345
+ PRIMARY KEY (`id`),
346
+ KEY `process_id` (`process_id` ASC),
347
+ KEY `process_logger` (`process_id` ASC, `logger` ASC),
348
+ KEY `function` (`function` ASC),
349
+ KEY `type` (`type` ASC))" );
350
+ } else {
351
+ /**
352
+ * Drop logging table.
353
+ */
354
+ $result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
355
+ }
356
+
357
+ if ( false !== $result ) {
358
+ update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
359
+ }
360
+
361
+ return ( false !== $result );
362
+ }
363
+
364
+ /**
365
+ * @author Vova Feldman (@svovaf)
366
+ * @since 1.2.1.6
367
+ *
368
+ * @param string $type
369
+ * @param string $message
370
+ * @param int $log_order
371
+ * @param array $caller
372
+ *
373
+ * @return false|int
374
+ */
375
+ private function db_log(
376
+ &$type,
377
+ &$message,
378
+ &$log_order,
379
+ &$caller
380
+ ) {
381
+ global $wpdb;
382
+
383
+ $request_type = 'call';
384
+ if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
385
+ $request_type = 'cron';
386
+ } else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
387
+ $request_type = 'ajax';
388
+ }
389
+
390
+ $request_url = WP_FS__IS_HTTP_REQUEST ?
391
+ $_SERVER['REQUEST_URI'] :
392
+ '';
393
+
394
+ return $wpdb->insert(
395
+ "{$wpdb->prefix}fs_logger",
396
+ array(
397
+ 'process_id' => self::$_processID,
398
+ 'user_name' => self::$_ownerName,
399
+ 'logger' => $this->_id,
400
+ 'log_order' => $log_order,
401
+ 'type' => $type,
402
+ 'request_type' => $request_type,
403
+ 'request_url' => $request_url,
404
+ 'message' => $message,
405
+ 'file' => isset( $caller['file'] ) ?
406
+ substr( $caller['file'], self::$_abspathLength ) :
407
+ '',
408
+ 'line' => $caller['line'],
409
+ 'function' => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
410
+ 'created' => microtime( true ),
411
+ )
412
+ );
413
+ }
414
+
415
+ /**
416
+ * Persistent DB logger columns.
417
+ *
418
+ * @var array
419
+ */
420
+ private static $_log_columns = array(
421
+ 'id',
422
+ 'process_id',
423
+ 'user_name',
424
+ 'logger',
425
+ 'log_order',
426
+ 'type',
427
+ 'message',
428
+ 'file',
429
+ 'line',
430
+ 'function',
431
+ 'request_type',
432
+ 'request_url',
433
+ 'created',
434
+ );
435
+
436
+ /**
437
+ * Create DB logs query.
438
+ *
439
+ * @author Vova Feldman (@svovaf)
440
+ * @since 1.2.1.6
441
+ *
442
+ * @param bool $filters
443
+ * @param int $limit
444
+ * @param int $offset
445
+ * @param bool $order
446
+ * @param bool $escape_eol
447
+ *
448
+ * @return string
449
+ */
450
+ private static function build_db_logs_query(
451
+ $filters = false,
452
+ $limit = 200,
453
+ $offset = 0,
454
+ $order = false,
455
+ $escape_eol = false
456
+ ) {
457
+ global $wpdb;
458
+
459
+ $select = '*';
460
+
461
+ if ( $escape_eol ) {
462
+ $select = '';
463
+ for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
464
+ if ( $i > 0 ) {
465
+ $select .= ', ';
466
+ }
467
+
468
+ if ( 'message' !== self::$_log_columns[ $i ] ) {
469
+ $select .= self::$_log_columns[ $i ];
470
+ } else {
471
+ $select .= 'REPLACE(message , \'\n\', \' \') AS message';
472
+ }
473
+ }
474
+ }
475
+
476
+ $query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
477
+ if ( is_array( $filters ) ) {
478
+ $criteria = array();
479
+
480
+ if ( ! empty( $filters['type'] ) && 'all' !== $filters['type'] ) {
481
+ $filters['type'] = strtolower( $filters['type'] );
482
+
483
+ switch ( $filters['type'] ) {
484
+ case 'warn_error':
485
+ $criteria[] = array( 'col' => 'type', 'val' => array( 'warn', 'error' ) );
486
+ break;
487
+ case 'error':
488
+ case 'warn':
489
+ $criteria[] = array( 'col' => 'type', 'val' => $filters['type'] );
490
+ break;
491
+ case 'info':
492
+ default:
493
+ $criteria[] = array( 'col' => 'type', 'val' => array( 'info', 'log' ) );
494
+ break;
495
+ }
496
+ }
497
+
498
+ if ( ! empty( $filters['request_type'] ) ) {
499
+ $filters['request_type'] = strtolower( $filters['request_type'] );
500
+
501
+ if ( in_array( $filters['request_type'], array( 'call', 'ajax', 'cron' ) ) ) {
502
+ $criteria[] = array( 'col' => 'request_type', 'val' => $filters['request_type'] );
503
+ }
504
+ }
505
+
506
+ if ( ! empty( $filters['file'] ) ) {
507
+ $criteria[] = array(
508
+ 'col' => 'file',
509
+ 'op' => 'LIKE',
510
+ 'val' => '%' . esc_sql( $filters['file'] ),
511
+ );
512
+ }
513
+
514
+ if ( ! empty( $filters['function'] ) ) {
515
+ $criteria[] = array(
516
+ 'col' => 'function',
517
+ 'op' => 'LIKE',
518
+ 'val' => '%' . esc_sql( $filters['function'] ),
519
+ );
520
+ }
521
+
522
+ if ( ! empty( $filters['process_id'] ) && is_numeric( $filters['process_id'] ) ) {
523
+ $criteria[] = array( 'col' => 'process_id', 'val' => $filters['process_id'] );
524
+ }
525
+
526
+ if ( ! empty( $filters['logger'] ) ) {
527
+ $criteria[] = array(
528
+ 'col' => 'logger',
529
+ 'op' => 'LIKE',
530
+ 'val' => '%' . esc_sql( $filters['logger'] ) . '%',
531
+ );
532
+ }
533
+
534
+ if ( ! empty( $filters['message'] ) ) {
535
+ $criteria[] = array(
536
+ 'col' => 'message',
537
+ 'op' => 'LIKE',
538
+ 'val' => '%' . esc_sql( $filters['message'] ) . '%',
539
+ );
540
+ }
541
+
542
+ if ( 0 < count( $criteria ) ) {
543
+ $query .= "\nWHERE\n";
544
+
545
+ $first = true;
546
+ foreach ( $criteria as $c ) {
547
+ if ( ! $first ) {
548
+ $query .= "AND\n";
549
+ }
550
+
551
+ if ( is_array( $c['val'] ) ) {
552
+ $operator = 'IN';
553
+
554
+ for ( $i = 0, $len = count( $c['val'] ); $i < $len; $i ++ ) {
555
+ $c['val'][ $i ] = "'" . esc_sql( $c['val'][ $i ] ) . "'";
556
+ }
557
+
558
+ $val = '(' . implode( ',', $c['val'] ) . ')';
559
+ } else {
560
+ $operator = ! empty( $c['op'] ) ? $c['op'] : '=';
561
+ $val = "'" . esc_sql( $c['val'] ) . "'";
562
+ }
563
+
564
+ $query .= "`{$c['col']}` {$operator} {$val}\n";
565
+
566
+ $first = false;
567
+ }
568
+ }
569
+ }
570
+
571
+ if ( ! is_array( $order ) ) {
572
+ $order = array(
573
+ 'col' => 'id',
574
+ 'order' => 'desc'
575
+ );
576
+ }
577
+
578
+ $query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
579
+
580
+ return $query;
581
+ }
582
+
583
+ /**
584
+ * Load logs from DB.
585
+ *
586
+ * @author Vova Feldman (@svovaf)
587
+ * @since 1.2.1.6
588
+ *
589
+ * @param bool $filters
590
+ * @param int $limit
591
+ * @param int $offset
592
+ * @param bool $order
593
+ *
594
+ * @return object[]|null
595
+ */
596
+ public static function load_db_logs(
597
+ $filters = false,
598
+ $limit = 200,
599
+ $offset = 0,
600
+ $order = false
601
+ ) {
602
+ global $wpdb;
603
+
604
+ $query = self::build_db_logs_query(
605
+ $filters,
606
+ $limit,
607
+ $offset,
608
+ $order
609
+ );
610
+
611
+ return $wpdb->get_results( $query );
612
+ }
613
+
614
+ /**
615
+ * Load logs from DB.
616
+ *
617
+ * @author Vova Feldman (@svovaf)
618
+ * @since 1.2.1.6
619
+ *
620
+ * @param bool $filters
621
+ * @param string $filename
622
+ * @param int $limit
623
+ * @param int $offset
624
+ * @param bool $order
625
+ *
626
+ * @return false|string File download URL or false on failure.
627
+ */
628
+ public static function download_db_logs(
629
+ $filters = false,
630
+ $filename = '',
631
+ $limit = 10000,
632
+ $offset = 0,
633
+ $order = false
634
+ ) {
635
+ global $wpdb;
636
+
637
+ $query = self::build_db_logs_query(
638
+ $filters,
639
+ $limit,
640
+ $offset,
641
+ $order,
642
+ true
643
+ );
644
+
645
+ $upload_dir = wp_upload_dir();
646
+ if ( empty( $filename ) ) {
647
+ $filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
648
+ }
649
+ $filepath = rtrim( $upload_dir['path'], '/' ) . "/{$filename}";
650
+
651
+ $query .= " INTO OUTFILE '{$filepath}' FIELDS TERMINATED BY '\t' ESCAPED BY '\\\\' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
652
+
653
+ $columns = '';
654
+ for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
655
+ if ( $i > 0 ) {
656
+ $columns .= ', ';
657
+ }
658
+
659
+ $columns .= "'" . self::$_log_columns[ $i ] . "'";
660
+ }
661
+
662
+ $query = "SELECT {$columns} UNION ALL " . $query;
663
+
664
+ $result = $wpdb->query( $query );
665
+
666
+ if ( false === $result ) {
667
+ return false;
668
+ }
669
+
670
+ return rtrim( $upload_dir['url'], '/' ) . '/' . $filename;
671
+ }
672
+
673
+ /**
674
+ * @author Vova Feldman (@svovaf)
675
+ * @since 1.2.1.6
676
+ *
677
+ * @param string $filename
678
+ *
679
+ * @return string
680
+ */
681
+ public static function get_logs_download_url( $filename = '' ) {
682
+ $upload_dir = wp_upload_dir();
683
+ if ( empty( $filename ) ) {
684
+ $filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
685
+ }
686
+
687
+ return rtrim( $upload_dir['url'], '/' ) . $filename;
688
+ }
689
+
690
+ #endregion
691
  }
includes/pum-sdk/freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -29,6 +29,13 @@
29
  * @since 1.1.8.1
30
  */
31
  private $_update_details;
 
 
 
 
 
 
 
32
 
33
  #--------------------------------------------------------------------------------
34
  #region Singleton
@@ -77,25 +84,25 @@
77
 
78
  $this->add_transient_filters();
79
 
80
- if ( ! $this->_fs->has_active_valid_license() ) {
81
- /**
82
- * If user has the premium plugin's code but do NOT have an active license,
83
- * encourage him to upgrade by showing that there's a new release, but instead
84
- * of showing an update link, show upgrade link to the pricing page.
85
- *
86
- * @since 1.1.6
87
- *
88
- */
89
- // WP 2.9+
90
- add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
91
- &$this,
92
- 'catch_plugin_update_row'
93
- ), 9 );
94
- add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
95
- &$this,
96
- 'edit_and_echo_plugin_update_row'
97
- ), 11, 2 );
98
- }
99
 
100
  if ( ! WP_FS__IS_PRODUCTION_MODE ) {
101
  add_filter( 'http_request_host_is_external', array(
@@ -105,16 +112,88 @@
105
  }
106
 
107
  if ( $this->_fs->is_premium() ) {
108
- if ( $this->is_correct_folder_name() ) {
109
  add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
110
  }
111
 
112
- if ( ! $this->_fs->has_active_valid_license() ) {
 
 
 
113
  add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
114
  }
115
  }
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  /**
119
  * @author Vova Feldman (@svovaf)
120
  * @since 2.0.0
@@ -178,15 +257,57 @@
178
 
179
  $r = $current->response[ $file ];
180
 
181
- $plugin_update_row = preg_replace(
182
- '/(\<div.+>)(.+)(\<a.+\<a.+)\<\/div\>/is',
183
- '$1 $2 ' . sprintf(
184
- $this->_fs->get_text_inline( '%sRenew your license now%s to access version %s security & feature updates, and support.', 'renew-license-now' ),
185
- '<a href="' . $this->_fs->pricing_url() . '">', '</a>',
186
- $r->new_version ) .
187
- '$4',
188
- $plugin_update_row
189
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
  echo $plugin_update_row;
192
  }
@@ -215,10 +336,7 @@
215
 
216
  $prepared_themes[ $theme_basename ]['update'] = preg_replace(
217
  '/(\<p.+>)(.+)(\<a.+\<a.+)\.(.+\<\/p\>)/is',
218
- '$1 $2 ' . sprintf(
219
- $this->_fs->get_text_inline( '%sRenew your license now%s to access version %s security & feature updates, and support.', 'renew-license-now' ),
220
- '<a href="' . $this->_fs->pricing_url() . '">', '</a>',
221
- $themes_update->response[ $theme_basename ]['new_version'] ) .
222
  '$4',
223
  $prepared_themes[ $theme_basename ]['update']
224
  );
@@ -298,7 +416,8 @@
298
  $new_version = $this->_fs->get_update(
299
  false,
300
  fs_request_get_bool( 'force-check' ),
301
- WP_FS__TIME_24_HOURS_IN_SEC / 24
 
302
  );
303
 
304
  $this->_update_details = false;
@@ -324,6 +443,46 @@
324
  (array) $this->_update_details;
325
  }
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  return $transient_data;
328
  }
329
 
@@ -356,6 +515,18 @@
356
  );
357
  }
358
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  $update->{$this->_fs->get_module_type()} = $this->_fs->get_plugin_basename();
360
 
361
  return $update;
@@ -508,6 +679,138 @@
508
  return $res;
509
  }
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  /**
512
  * Updates information on the "View version x.x details" page with custom data.
513
  *
@@ -571,11 +874,13 @@ if ( !isset($info->error) ) {
571
  }*/
572
  }
573
 
 
 
574
  // Get plugin's newest update.
575
- $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false );
576
 
577
  if ( ! is_object( $new_version ) || empty( $new_version->version ) ) {
578
- $data->version = $this->_fs->get_plugin_version();
579
  } else {
580
  if ( $is_addon ) {
581
  $data->name = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
@@ -592,6 +897,52 @@ if ( !isset($info->error) ) {
592
 
593
  $data->version = $new_version->version;
594
  $data->download_link = $new_version->url;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  }
596
 
597
  return $data;
@@ -602,11 +953,13 @@ if ( !isset($info->error) ) {
602
  * @since 1.2.1.7
603
  *
604
  * @param number|bool $addon_id
 
 
605
  *
606
  * @return object
607
  */
608
- private function get_latest_download_details( $addon_id = false ) {
609
- return $this->_fs->_fetch_latest_version( $addon_id );
610
  }
611
 
612
  /**
@@ -616,16 +969,10 @@ if ( !isset($info->error) ) {
616
  * @author Vova Feldman (@svovaf)
617
  * @since 1.2.1.6
618
  *
619
- * @param string $basename Current plugin's basename.
620
- *
621
  * @return bool
622
  */
623
- private function is_correct_folder_name( $basename = '' ) {
624
- if ( empty( $basename ) ) {
625
- $basename = $this->_fs->get_plugin_basename();
626
- }
627
-
628
- return ( $this->_fs->get_target_folder_name() != trim( dirname( $basename ), '/\\' ) );
629
  }
630
 
631
  /**
@@ -661,7 +1008,7 @@ if ( !isset($info->error) ) {
661
  $filename = basename( $basename );
662
 
663
  $new_basename = plugin_basename(
664
- trailingslashit( $this->_fs->get_slug() . ( $this->_fs->is_premium() ? '-premium' : '' ) ) .
665
  $filename
666
  );
667
 
@@ -729,14 +1076,16 @@ if ( !isset($info->error) ) {
729
  );
730
  }
731
 
732
- $slug = $addon->slug;
733
- $title = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
 
734
 
735
  $is_addon = true;
736
  } else {
737
- $slug = $this->_fs->get_slug();
738
- $title = $this->_fs->get_plugin_title() .
739
- ( $this->_fs->is_addon() ? ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' ) : '' );
 
740
  }
741
 
742
  if ( $this->is_premium_plugin_active( $plugin_id ) ) {
@@ -749,8 +1098,8 @@ if ( !isset($info->error) ) {
749
  );
750
  }
751
 
752
- $latest_version = $this->get_latest_download_details( $plugin_id );
753
- $target_folder = "{$slug}-premium";
754
 
755
  // Prep variables for Plugin_Installer_Skin class.
756
  $extra = array();
@@ -789,11 +1138,11 @@ if ( !isset($info->error) ) {
789
  $upgrader = new Plugin_Upgrader( $skin );
790
 
791
  // Perform the action and install the plugin from the $source urldecode().
792
- add_filter( 'upgrader_source_selection', array( &$this, '_maybe_adjust_source_dir' ), 1, 3 );
793
 
794
  $install_result = $upgrader->install( $source );
795
 
796
- remove_filter( 'upgrader_source_selection', array( &$this, '_maybe_adjust_source_dir' ), 1 );
797
 
798
  if ( is_wp_error( $install_result ) ) {
799
  return array(
@@ -883,6 +1232,29 @@ if ( !isset($info->error) ) {
883
  return is_plugin_active( $this->_fs->premium_plugin_basename() );
884
  }
885
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
886
  /**
887
  * Adjust the plugin directory name if necessary.
888
  * Assumes plugin has a folder (not a single file plugin).
@@ -894,6 +1266,7 @@ if ( !isset($info->error) ) {
894
  *
895
  * @author Vova Feldman
896
  * @since 1.2.1.7
 
897
  *
898
  * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
899
  * @param string $remote_source Path to upgrade/zip-file-name.tmp.
@@ -901,13 +1274,64 @@ if ( !isset($info->error) ) {
901
  *
902
  * @return string|WP_Error
903
  */
904
- function _maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
905
  if ( ! is_object( $GLOBALS['wp_filesystem'] ) ) {
906
  return $source;
907
  }
908
 
 
 
 
909
  // Figure out what the slug is supposed to be.
910
- $desired_slug = $upgrader->skin->options['extra']['slug'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
911
 
912
  $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
913
 
@@ -917,19 +1341,20 @@ if ( !isset($info->error) ) {
917
 
918
  if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
919
  return trailingslashit( $to_path );
920
- } else {
921
- return new WP_Error(
922
- 'rename_failed',
923
- $this->_fs->get_text_inline( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'module-package-rename-failure' ),
924
- array(
925
- 'found' => $subdir_name,
926
- 'expected' => $desired_slug
927
- ) );
928
  }
 
 
 
 
 
 
 
 
 
929
  }
930
 
931
  return $source;
932
  }
933
 
934
  #endregion
935
- }
29
  * @since 1.1.8.1
30
  */
31
  private $_update_details;
32
+ /**
33
+ * @var array
34
+ * @since 2.1.2
35
+ */
36
+ private $_translation_updates;
37
+
38
+ private static $_upgrade_basename = null;
39
 
40
  #--------------------------------------------------------------------------------
41
  #region Singleton
84
 
85
  $this->add_transient_filters();
86
 
87
+ /**
88
+ * If user has the premium plugin's code but do NOT have an active license,
89
+ * encourage him to upgrade by showing that there's a new release, but instead
90
+ * of showing an update link, show upgrade link to the pricing page.
91
+ *
92
+ * @since 1.1.6
93
+ *
94
+ */
95
+ // WP 2.9+
96
+ add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
97
+ &$this,
98
+ 'catch_plugin_update_row'
99
+ ), 9 );
100
+ add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
101
+ &$this,
102
+ 'edit_and_echo_plugin_update_row'
103
+ ), 11, 2 );
104
+
105
+ add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );
106
 
107
  if ( ! WP_FS__IS_PRODUCTION_MODE ) {
108
  add_filter( 'http_request_host_is_external', array(
112
  }
113
 
114
  if ( $this->_fs->is_premium() ) {
115
+ if ( ! $this->is_correct_folder_name() ) {
116
  add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
117
  }
118
 
119
+ add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
120
+ add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
121
+
122
+ if ( ! $this->_fs->has_any_active_valid_license() ) {
123
  add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
124
  }
125
  }
126
  }
127
 
128
+ /**
129
+ * @author Leo Fajardo (@leorw)
130
+ * @since 2.1.4
131
+ */
132
+ function catch_plugin_information_dialog_contents() {
133
+ if (
134
+ 'plugin-information' !== fs_request_get( 'tab', false ) ||
135
+ $this->_fs->get_slug() !== fs_request_get( 'plugin', false )
136
+ ) {
137
+ return;
138
+ }
139
+
140
+ add_action( 'admin_footer', array( &$this, 'edit_and_echo_plugin_information_dialog_contents' ), 0, 1 );
141
+
142
+ ob_start();
143
+ }
144
+
145
+ /**
146
+ * @author Leo Fajardo (@leorw)
147
+ * @since 2.1.4
148
+ *
149
+ * @param string $hook_suffix
150
+ */
151
+ function edit_and_echo_plugin_information_dialog_contents( $hook_suffix ) {
152
+ if (
153
+ 'plugin-information' !== fs_request_get( 'tab', false ) ||
154
+ $this->_fs->get_slug() !== fs_request_get( 'plugin', false )
155
+ ) {
156
+ return;
157
+ }
158
+
159
+ $license = $this->_fs->_get_license();
160
+
161
+ $subscription = ( is_object( $license ) && ! $license->is_lifetime() ) ?
162
+ $this->_fs->_get_subscription( $license->id ) :
163
+ null;
164
+
165
+ $contents = ob_get_clean();
166
+
167
+ /**
168
+ * Replace the plugin information dialog's "Install Update Now" button's text and URL. If there's a license,
169
+ * the text will be "Renew license" and will link to the checkout page with the license's billing cycle
170
+ * and quota. If there's no license, the text will be "Buy license" and will link to the pricing page.
171
+ */
172
+ $contents = preg_replace(
173
+ '/(.+\<a.+)(id="plugin_update_from_iframe")(.+href=")([^\s]+)(".+\>)(.+)(\<\/a.+)/is',
174
+ is_object( $license ) ?
175
+ sprintf(
176
+ '$1$3%s$5%s$7',
177
+ $this->_fs->checkout_url(
178
+ is_object( $subscription ) ?
179
+ ( 1 == $subscription->billing_cycle ? WP_FS__PERIOD_MONTHLY : WP_FS__PERIOD_ANNUALLY ) :
180
+ WP_FS__PERIOD_LIFETIME,
181
+ false,
182
+ array( 'licenses' => $license->quota )
183
+ ),
184
+ fs_text_inline( 'Renew license', 'renew-license', $this->_fs->get_slug() )
185
+ ) :
186
+ sprintf(
187
+ '$1$3%s$5%s$7',
188
+ $this->_fs->pricing_url(),
189
+ fs_text_inline( 'Buy license', 'buy-license', $this->_fs->get_slug() )
190
+ ),
191
+ $contents
192
+ );
193
+
194
+ echo $contents;
195
+ }
196
+
197
  /**
198
  * @author Vova Feldman (@svovaf)
199
  * @since 2.0.0
257
 
258
  $r = $current->response[ $file ];
259
 
260
+ if ( ! $this->_fs->has_any_active_valid_license() ) {
261
+ /**
262
+ * Turn the "new version" text into a link that opens the plugin information dialog when clicked and
263
+ * make the "View version x details" text link to the checkout page instead of opening the plugin
264
+ * information dialog when clicked.
265
+ *
266
+ * Sample input:
267
+ * There is a new version of Awesome Plugin available. <a href="...>View version x.y.z details</a> or <a href="...>update now</a>.
268
+ * Output:
269
+ * There is a <a href="...>new version</a> of Awesome Plugin available. <a href="...>Buy a license now</a> to access version x.y.z security & feature updates, and support.
270
+ *
271
+ * @author Leo Fajardo (@leorw)
272
+ */
273
+ $plugin_update_row = preg_replace(
274
+ '/(\<div.+>)(.+)(\<a.+href="([^\s]+)"([^\<]+)\>.+\<a.+)(\<\/div\>)/is',
275
+ (
276
+ '$1' .
277
+ sprintf(
278
+ fs_text_inline( 'There is a %s of %s available.', 'new-version-available', $this->_fs->get_slug() ),
279
+ sprintf(
280
+ '<a href="$4"%s>%s</a>',
281
+ '$5',
282
+ fs_text_inline( 'new version', 'new-version', $this->_fs->get_slug() )
283
+ ),
284
+ $this->_fs->get_plugin_title()
285
+ ) .
286
+ ' ' .
287
+ $this->_fs->version_upgrade_checkout_link( $r->new_version ) .
288
+ '$6'
289
+ ),
290
+ $plugin_update_row
291
+ );
292
+ }
293
+
294
+ if (
295
+ $this->_fs->is_plugin() &&
296
+ isset( $r->upgrade_notice ) &&
297
+ strlen( trim( $r->upgrade_notice ) ) > 0
298
+ ) {
299
+ $slug = $this->_fs->get_slug();
300
+
301
+ $upgrade_notice_html = sprintf(
302
+ '<p class="notice fs-upgrade-notice fs-slug-%1s fs-type-%2s" data-slug="%1s" data-type="%2s"><strong>%3s</strong> %4s</p>',
303
+ $slug,
304
+ $this->_fs->get_module_type(),
305
+ fs_text_inline( 'Important Upgrade Notice:', 'upgrade_notice', $slug ),
306
+ esc_html( $r->upgrade_notice )
307
+ );
308
+
309
+ $plugin_update_row = str_replace( '</div>', '</div>' . $upgrade_notice_html, $plugin_update_row );
310
+ }
311
 
312
  echo $plugin_update_row;
313
  }
336
 
337
  $prepared_themes[ $theme_basename ]['update'] = preg_replace(
338
  '/(\<p.+>)(.+)(\<a.+\<a.+)\.(.+\<\/p\>)/is',
339
+ '$1 $2 ' . $this->_fs->version_upgrade_checkout_link( $themes_update->response[ $theme_basename ]['new_version'] ) .
 
 
 
340
  '$4',
341
  $prepared_themes[ $theme_basename ]['update']
342
  );
416
  $new_version = $this->_fs->get_update(
417
  false,
418
  fs_request_get_bool( 'force-check' ),
419
+ WP_FS__TIME_24_HOURS_IN_SEC / 24,
420
+ $this->_fs->get_plugin_version()
421
  );
422
 
423
  $this->_update_details = false;
443
  (array) $this->_update_details;
444
  }
445
 
446
+ $slug = $this->_fs->get_slug();
447
+
448
+ if ( $this->_fs->is_org_repo_compliant() && $this->_fs->is_freemium() ) {
449
+ if ( ! isset( $this->_translation_updates ) ) {
450
+ $this->_translation_updates = array();
451
+
452
+ if ( current_user_can( 'update_languages' ) ) {
453
+ $translation_updates = $this->fetch_wp_org_module_translation_updates( $module_type, $slug );
454
+ if ( ! empty( $translation_updates ) ) {
455
+ $this->_translation_updates = $translation_updates;
456
+ }
457
+ }
458
+ }
459
+
460
+ if ( ! empty( $this->_translation_updates ) ) {
461
+ $all_translation_updates = ( isset( $transient_data->translations ) && is_array( $transient_data->translations ) ) ?
462
+ $transient_data->translations :
463
+ array();
464
+
465
+ $current_plugin_translation_updates_map = array();
466
+ foreach ( $all_translation_updates as $key => $translation_update ) {
467
+ if ( $module_type === ( $translation_update['type'] . 's' ) && $slug === $translation_update['slug'] ) {
468
+ $current_plugin_translation_updates_map[ $translation_update['language'] ] = $translation_update;
469
+ unset( $all_translation_updates[ $key ] );
470
+ }
471
+ }
472
+
473
+ foreach ( $this->_translation_updates as $translation_update ) {
474
+ $lang = $translation_update['language'];
475
+ if ( ! isset( $current_plugin_translation_updates_map[ $lang ] ) ||
476
+ version_compare( $translation_update['version'], $current_plugin_translation_updates_map[ $lang ]['version'], '>' )
477
+ ) {
478
+ $current_plugin_translation_updates_map[ $lang ] = $translation_update;
479
+ }
480
+ }
481
+
482
+ $transient_data->translations = array_merge( $all_translation_updates, array_values( $current_plugin_translation_updates_map ) );
483
+ }
484
+ }
485
+
486
  return $transient_data;
487
  }
488
 
515
  );
516
  }
517
 
518
+ if ( $this->_fs->is_premium() ) {
519
+ $latest_tag = $this->_fs->_fetch_latest_version( $this->_fs->get_id(), false );
520
+
521
+ if (
522
+ isset( $latest_tag->readme ) &&
523
+ isset( $latest_tag->readme->upgrade_notice ) &&
524
+ ! empty( $latest_tag->readme->upgrade_notice )
525
+ ) {
526
+ $update->upgrade_notice = $latest_tag->readme->upgrade_notice;
527
+ }
528
+ }
529
+
530
  $update->{$this->_fs->get_module_type()} = $this->_fs->get_plugin_basename();
531
 
532
  return $update;
679
  return $res;
680
  }
681
 
682
+ /**
683
+ * Fetches module translation updates from wordpress.org.
684
+ *
685
+ * @author Leo Fajardo (@leorw)
686
+ * @since 2.1.2
687
+ *
688
+ * @param string $module_type
689
+ * @param string $slug
690
+ *
691
+ * @return array|null
692
+ */
693
+ private function fetch_wp_org_module_translation_updates( $module_type, $slug ) {
694
+ $plugin_data = $this->_fs->get_plugin_data();
695
+
696
+ $locales = array_values( get_available_languages() );
697
+ $locales = apply_filters( "{$module_type}_update_check_locales", $locales );
698
+ $locales = array_unique( $locales );
699
+
700
+ $plugin_basename = $this->_fs->get_plugin_basename();
701
+ if ( 'themes' === $module_type ) {
702
+ $plugin_basename = $slug;
703
+ }
704
+
705
+ global $wp_version;
706
+
707
+ $request_args = array(
708
+ 'timeout' => 15,
709
+ 'body' => array(
710
+ "{$module_type}" => json_encode(
711
+ array(
712
+ "{$module_type}" => array(
713
+ $plugin_basename => array(
714
+ 'Name' => trim( str_replace( $this->_fs->get_plugin()->premium_suffix, '', $plugin_data['Name'] ) ),
715
+ 'Author' => $plugin_data['Author'],
716
+ )
717
+ )
718
+ )
719
+ ),
720
+ 'translations' => json_encode( $this->get_installed_translations( $module_type, $slug ) ),
721
+ 'locale' => json_encode( $locales )
722
+ ),
723
+ 'user-agent' => ( 'WordPress/' . $wp_version . '; ' . home_url( '/' ) )
724
+ );
725
+
726
+ $url = "http://api.wordpress.org/{$module_type}/update-check/1.1/";
727
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
728
+ $url = set_url_scheme( $url, 'https' );
729
+ }
730
+
731
+ $raw_response = Freemius::safe_remote_post(
732
+ $url,
733
+ $request_args,
734
+ WP_FS__TIME_24_HOURS_IN_SEC,
735
+ WP_FS__TIME_12_HOURS_IN_SEC,
736
+ false
737
+ );
738
+
739
+ if ( is_wp_error( $raw_response ) ) {
740
+ return null;
741
+ }
742
+
743
+ $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
744
+
745
+ if ( ! is_array( $response ) ) {
746
+ return null;
747
+ }
748
+
749
+ if ( ! isset( $response['translations'] ) || empty( $response['translations'] ) ) {
750
+ return null;
751
+ }
752
+
753
+ return $response['translations'];
754
+ }
755
+
756
+ /**
757
+ * @author Leo Fajardo (@leorw)
758
+ * @since 2.1.2
759
+ *
760
+ * @param string $module_type
761
+ * @param string $slug
762
+ *
763
+ * @return array
764
+ */
765
+ private function get_installed_translations( $module_type, $slug ) {
766
+ if ( function_exists( 'wp_get_installed_translations' ) ) {
767
+ return wp_get_installed_translations( $module_type );
768
+ }
769
+
770
+ $dir = "/{$module_type}";
771
+
772
+ if ( ! is_dir( WP_LANG_DIR . $dir ) )
773
+ return array();
774
+
775
+ $files = scandir( WP_LANG_DIR . $dir );
776
+ if ( ! $files )
777
+ return array();
778
+
779
+ $language_data = array();
780
+
781
+ foreach ( $files as $file ) {
782
+ if ( 0 !== strpos( $file, $slug ) ) {
783
+ continue;
784
+ }
785
+
786
+ if ( '.' === $file[0] || is_dir( WP_LANG_DIR . "{$dir}/{$file}" ) ) {
787
+ continue;
788
+ }
789
+
790
+ if ( substr( $file, -3 ) !== '.po' ) {
791
+ continue;
792
+ }
793
+
794
+ if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {
795
+ continue;
796
+ }
797
+
798
+ if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) ) {
799
+ continue;
800
+ }
801
+
802
+ list( , $textdomain, $language ) = $match;
803
+
804
+ if ( '' === $textdomain ) {
805
+ $textdomain = 'default';
806
+ }
807
+
808
+ $language_data[ $textdomain ][ $language ] = wp_get_pomo_file_data( WP_LANG_DIR . "{$dir}/{$file}" );
809
+ }
810
+
811
+ return $language_data;
812
+ }
813
+
814
  /**
815
  * Updates information on the "View version x.x details" page with custom data.
816
  *
874
  }*/
875
  }
876
 
877
+ $plugin_version = $this->_fs->get_plugin_version();
878
+
879
  // Get plugin's newest update.
880
+ $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false, $plugin_version );
881
 
882
  if ( ! is_object( $new_version ) || empty( $new_version->version ) ) {
883
+ $data->version = $plugin_version;
884
  } else {
885
  if ( $is_addon ) {
886
  $data->name = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
897
 
898
  $data->version = $new_version->version;
899
  $data->download_link = $new_version->url;
900
+
901
+ if ( isset( $new_version->readme ) && is_object( $new_version->readme ) ) {
902
+ $new_version_readme_data = $new_version->readme;
903
+ if ( isset( $new_version_readme_data->sections ) ) {
904
+ $new_version_readme_data->sections = (array) $new_version_readme_data->sections;
905
+ } else {
906
+ $new_version_readme_data->sections = array();
907
+ }
908
+
909
+ if ( isset( $data->sections ) ) {
910
+ if ( isset( $data->sections['screenshots'] ) ) {
911
+ $new_version_readme_data->sections['screenshots'] = $data->sections['screenshots'];
912
+ }
913
+
914
+ if ( isset( $data->sections['reviews'] ) ) {
915
+ $new_version_readme_data->sections['reviews'] = $data->sections['reviews'];
916
+ }
917
+ }
918
+
919
+ if ( isset( $new_version_readme_data->banners ) ) {
920
+ $new_version_readme_data->banners = (array) $new_version_readme_data->banners;
921
+ } else if ( isset( $data->banners ) ) {
922
+ $new_version_readme_data->banners = $data->banners;
923
+ }
924
+
925
+ $wp_org_sections = array(
926
+ 'author',
927
+ 'author_profile',
928
+ 'rating',
929
+ 'ratings',
930
+ 'num_ratings',
931
+ 'support_threads',
932
+ 'support_threads_resolved',
933
+ 'active_installs',
934
+ 'added',
935
+ 'homepage'
936
+ );
937
+
938
+ foreach ( $wp_org_sections as $wp_org_section ) {
939
+ if ( isset( $data->{$wp_org_section} ) ) {
940
+ $new_version_readme_data->{$wp_org_section} = $data->{$wp_org_section};
941
+ }
942
+ }
943
+
944
+ $data = $new_version_readme_data;
945
+ }
946
  }
947
 
948
  return $data;
953
  * @since 1.2.1.7
954
  *
955
  * @param number|bool $addon_id
956
+ * @param bool|string $newer_than Since 2.2.1
957
+ * @param bool|string $fetch_readme Since 2.2.1
958
  *
959
  * @return object
960
  */
961
+ private function get_latest_download_details( $addon_id = false, $newer_than = false, $fetch_readme = true ) {
962
+ return $this->_fs->_fetch_latest_version( $addon_id, true, WP_FS__TIME_24_HOURS_IN_SEC, $newer_than, $fetch_readme );
963
  }
964
 
965
  /**
969
  * @author Vova Feldman (@svovaf)
970
  * @since 1.2.1.6
971
  *
 
 
972
  * @return bool
973
  */
974
+ private function is_correct_folder_name() {
975
+ return ( $this->_fs->get_target_folder_name() == trim( dirname( $this->_fs->get_plugin_basename() ), '/\\' ) );
 
 
 
 
976
  }
977
 
978
  /**
1008
  $filename = basename( $basename );
1009
 
1010
  $new_basename = plugin_basename(
1011
+ trailingslashit( $this->_fs->is_premium() ? $this->_fs->get_premium_slug() : $this->_fs->get_slug() ) .
1012
  $filename
1013
  );
1014
 
1076
  );
1077
  }
1078
 
1079
+ $slug = $addon->slug;
1080
+ $premium_slug = $addon->premium_slug;
1081
+ $title = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
1082
 
1083
  $is_addon = true;
1084
  } else {
1085
+ $slug = $this->_fs->get_slug();
1086
+ $premium_slug = $this->_fs->get_premium_slug();
1087
+ $title = $this->_fs->get_plugin_title() .
1088
+ ( $this->_fs->is_addon() ? ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' ) : '' );
1089
  }
1090
 
1091
  if ( $this->is_premium_plugin_active( $plugin_id ) ) {
1098
  );
1099
  }
1100
 
1101
+ $latest_version = $this->get_latest_download_details( $plugin_id, false, false );
1102
+ $target_folder = $premium_slug;
1103
 
1104
  // Prep variables for Plugin_Installer_Skin class.
1105
  $extra = array();
1138
  $upgrader = new Plugin_Upgrader( $skin );
1139
 
1140
  // Perform the action and install the plugin from the $source urldecode().
1141
+ add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
1142
 
1143
  $install_result = $upgrader->install( $source );
1144
 
1145
+ remove_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1 );
1146
 
1147
  if ( is_wp_error( $install_result ) ) {
1148
  return array(
1232
  return is_plugin_active( $this->_fs->premium_plugin_basename() );
1233
  }
1234
 
1235
+ /**
1236
+ * Store the basename since it's not always available in the `_maybe_adjust_source_dir` method below.
1237
+ *
1238
+ * @author Leo Fajardo (@leorw)
1239
+ * @since 2.2.1
1240
+ *
1241
+ * @param bool|WP_Error $response Response.
1242
+ * @param array $hook_extra Extra arguments passed to hooked filters.
1243
+ *
1244
+ * @return bool|WP_Error
1245
+ */
1246
+ static function _store_basename_for_source_adjustment( $response, $hook_extra ) {
1247
+ if ( isset( $hook_extra['plugin'] ) ) {
1248
+ self::$_upgrade_basename = $hook_extra['plugin'];
1249
+ } else if ( isset( $hook_extra['theme'] ) ) {
1250
+ self::$_upgrade_basename = $hook_extra['theme'];
1251
+ } else {
1252
+ self::$_upgrade_basename = null;
1253
+ }
1254
+
1255
+ return $response;
1256
+ }
1257
+
1258
  /**
1259
  * Adjust the plugin directory name if necessary.
1260
  * Assumes plugin has a folder (not a single file plugin).
1266
  *
1267
  * @author Vova Feldman
1268
  * @since 1.2.1.7
1269
+ * @since 2.2.1 The method was converted to static since when the admin update bulk products via the Updates section, the logic applies the `upgrader_source_selection` filter for every product that is being updated.
1270
  *
1271
  * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
1272
  * @param string $remote_source Path to upgrade/zip-file-name.tmp.
1274
  *
1275
  * @return string|WP_Error
1276
  */
1277
+ static function _maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
1278
  if ( ! is_object( $GLOBALS['wp_filesystem'] ) ) {
1279
  return $source;
1280
  }
1281
 
1282
+ $basename = self::$_upgrade_basename;
1283
+ $is_theme = false;
1284
+
1285
  // Figure out what the slug is supposed to be.
1286
+ if ( isset( $upgrader->skin->options['extra'] ) ) {
1287
+ // Set by the auto-install logic.
1288
+ $desired_slug = $upgrader->skin->options['extra']['slug'];
1289
+ } else if ( ! empty( $basename ) ) {
1290
+ /**
1291
+ * If it doesn't end with ".php", it's a theme.
1292
+ *
1293
+ * @author Leo Fajardo (@leorw)
1294
+ * @since 2.2.1
1295
+ */
1296
+ $is_theme = ( ! fs_ends_with( $basename, '.php' ) );
1297
+
1298
+ $desired_slug = ( ! $is_theme ) ?
1299
+ dirname( $basename ) :
1300
+ // Theme slug
1301
+ $basename;
1302
+ } else {
1303
+ // Can't figure out the desired slug, stop the execution.
1304
+ return $source;
1305
+ }
1306
+
1307
+ if ( is_multisite() ) {
1308
+ /**
1309
+ * If we are running in a multisite environment and the product is not network activated,
1310
+ * the instance will not exist anyway. Therefore, try to update the source if necessary
1311
+ * regardless if the Freemius instance of the product exists or not.
1312
+ *
1313
+ * @author Vova Feldman
1314
+ */
1315
+ } else if ( ! empty( $basename ) ) {
1316
+ $fs = Freemius::get_instance_by_file(
1317
+ $basename,
1318
+ $is_theme ?
1319
+ WP_FS__MODULE_TYPE_THEME :
1320
+ WP_FS__MODULE_TYPE_PLUGIN
1321
+ );
1322
+
1323
+ if ( ! is_object( $fs ) ) {
1324
+ /**
1325
+ * If the Freemius instance does not exist on a non-multisite network environment, it means that:
1326
+ * 1. The product is not powered by Freemius; OR
1327
+ * 2. The product is not activated, therefore, we don't mind if after the update the folder name will change.
1328
+ *
1329
+ * @author Leo Fajardo (@leorw)
1330
+ * @since 2.2.1
1331
+ */
1332
+ return $source;
1333
+ }
1334
+ }
1335
 
1336
  $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
1337
 
1341
 
1342
  if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
1343
  return trailingslashit( $to_path );
 
 
 
 
 
 
 
 
1344
  }
1345
+
1346
+ return new WP_Error(
1347
+ 'rename_failed',
1348
+ fs_text_inline( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'module-package-rename-failure' ),
1349
+ array(
1350
+ 'found' => $subdir_name,
1351
+ 'expected' => $desired_slug
1352
+ )
1353
+ );
1354
  }
1355
 
1356
  return $source;
1357
  }
1358
 
1359
  #endregion
1360
+ }
includes/pum-sdk/freemius/includes/class-fs-security.php CHANGED
@@ -1,85 +1,85 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- define( 'WP_FS__SECURITY_PARAMS_PREFIX', 's_' );
14
-
15
- /**
16
- * Class FS_Security
17
- */
18
- class FS_Security {
19
- /**
20
- * @var FS_Security
21
- * @since 1.0.3
22
- */
23
- private static $_instance;
24
- /**
25
- * @var FS_Logger
26
- * @since 1.0.3
27
- */
28
- private static $_logger;
29
-
30
- /**
31
- * @return \FS_Security
32
- */
33
- public static function instance() {
34
- if ( ! isset( self::$_instance ) ) {
35
- self::$_instance = new FS_Security();
36
- self::$_logger = FS_Logger::get_logger(
37
- WP_FS__SLUG,
38
- WP_FS__DEBUG_SDK,
39
- WP_FS__ECHO_DEBUG_SDK
40
- );
41
- }
42
-
43
- return self::$_instance;
44
- }
45
-
46
- private function __construct() {
47
- }
48
-
49
- /**
50
- * @param \FS_Scope_Entity $entity
51
- * @param int $timestamp
52
- * @param string $action
53
- *
54
- * @return string
55
- */
56
- function get_secure_token( FS_Scope_Entity $entity, $timestamp, $action = '' ) {
57
- return md5(
58
- $timestamp .
59
- $entity->id .
60
- $entity->secret_key .
61
- $entity->public_key .
62
- $action
63
- );
64
- }
65
-
66
- /**
67
- * @param \FS_Scope_Entity $entity
68
- * @param int|bool $timestamp
69
- * @param string $action
70
- *
71
- * @return array
72
- */
73
- function get_context_params( FS_Scope_Entity $entity, $timestamp = false, $action = '' ) {
74
- if ( false === $timestamp ) {
75
- $timestamp = time();
76
- }
77
-
78
- return array(
79
- 's_ctx_type' => $entity->get_type(),
80
- 's_ctx_id' => $entity->id,
81
- 's_ctx_ts' => $timestamp,
82
- 's_ctx_secure' => $this->get_secure_token( $entity, $timestamp, $action ),
83
- );
84
- }
85
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ define( 'WP_FS__SECURITY_PARAMS_PREFIX', 's_' );
14
+
15
+ /**
16
+ * Class FS_Security
17
+ */
18
+ class FS_Security {
19
+ /**
20
+ * @var FS_Security
21
+ * @since 1.0.3
22
+ */
23
+ private static $_instance;
24
+ /**
25
+ * @var FS_Logger
26
+ * @since 1.0.3
27
+ */
28
+ private static $_logger;
29
+
30
+ /**
31
+ * @return \FS_Security
32
+ */
33
+ public static function instance() {
34
+ if ( ! isset( self::$_instance ) ) {
35
+ self::$_instance = new FS_Security();
36
+ self::$_logger = FS_Logger::get_logger(
37
+ WP_FS__SLUG,
38
+ WP_FS__DEBUG_SDK,
39
+ WP_FS__ECHO_DEBUG_SDK
40
+ );
41
+ }
42
+
43
+ return self::$_instance;
44
+ }
45
+
46
+ private function __construct() {
47
+ }
48
+
49
+ /**
50
+ * @param \FS_Scope_Entity $entity
51
+ * @param int $timestamp
52
+ * @param string $action
53
+ *
54
+ * @return string
55
+ */
56
+ function get_secure_token( FS_Scope_Entity $entity, $timestamp, $action = '' ) {
57
+ return md5(
58
+ $timestamp .
59
+ $entity->id .
60
+ $entity->secret_key .
61
+ $entity->public_key .
62
+ $action
63
+ );
64
+ }
65
+
66
+ /**
67
+ * @param \FS_Scope_Entity $entity
68
+ * @param int|bool $timestamp
69
+ * @param string $action
70
+ *
71
+ * @return array
72
+ */
73
+ function get_context_params( FS_Scope_Entity $entity, $timestamp = false, $action = '' ) {
74
+ if ( false === $timestamp ) {
75
+ $timestamp = time();
76
+ }
77
+
78
+ return array(
79
+ 's_ctx_type' => $entity->get_type(),
80
+ 's_ctx_id' => $entity->id,
81
+ 's_ctx_ts' => $timestamp,
82
+ 's_ctx_secure' => $this->get_secure_token( $entity, $timestamp, $action ),
83
+ );
84
+ }
85
+ }
includes/pum-sdk/freemius/includes/class-fs-storage.php CHANGED
@@ -132,9 +132,8 @@
132
  * @param int $blog_id
133
  */
134
  function set_site_blog_context( $blog_id ) {
 
135
  $this->_blog_id = $blog_id;
136
-
137
- $this->_storage = $this->get_site_storage( $this->_blog_id );
138
  }
139
 
140
  /**
@@ -374,6 +373,7 @@
374
  // When network activated, then network level.
375
  'install_timestamp' => 1,
376
  'prev_is_premium' => 1,
 
377
 
378
  // If not network activated OR delegated, then site level.
379
  'activation_timestamp' => 2,
132
  * @param int $blog_id
133
  */
134
  function set_site_blog_context( $blog_id ) {
135
+ $this->_storage = $this->get_site_storage( $blog_id );
136
  $this->_blog_id = $blog_id;
 
 
137
  }
138
 
139
  /**
373
  // When network activated, then network level.
374
  'install_timestamp' => 1,
375
  'prev_is_premium' => 1,
376
+ 'require_license_activation' => 1,
377
 
378
  // If not network activated OR delegated, then site level.
379
  'activation_timestamp' => 2,
includes/pum-sdk/freemius/includes/class-fs-user-lock.php CHANGED
@@ -1,126 +1,126 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 2.1.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_User_Lock
15
- */
16
- class FS_User_Lock {
17
- /**
18
- * @var int
19
- */
20
- private $_wp_user_id;
21
- /**
22
- * @var int
23
- */
24
- private $_thread_id;
25
-
26
- #--------------------------------------------------------------------------------
27
- #region Singleton
28
- #--------------------------------------------------------------------------------
29
-
30
- /**
31
- * @var FS_User_Lock
32
- */
33
- private static $_instance;
34
-
35
- /**
36
- * @author Vova Feldman (@svovaf)
37
- * @since 2.1.0
38
- *
39
- * @return FS_User_Lock
40
- */
41
- static function instance() {
42
- if ( ! isset( self::$_instance ) ) {
43
- self::$_instance = new self();
44
- }
45
-
46
- return self::$_instance;
47
- }
48
-
49
- #endregion
50
-
51
- private function __construct() {
52
- $this->_wp_user_id = Freemius::get_current_wp_user_id();
53
- $this->_thread_id = mt_rand( 0, 32000 );
54
- }
55
-
56
-
57
- /**
58
- * Try to acquire lock. If the lock is already set or is being acquired by another locker, don't do anything.
59
- *
60
- * @author Vova Feldman (@svovaf)
61
- * @since 2.1.0
62
- *
63
- * @param int $expiration
64
- *
65
- * @return bool TRUE if successfully acquired lock.
66
- */
67
- function try_lock( $expiration = 0 ) {
68
- if ( $this->is_locked() ) {
69
- // Already locked.
70
- return false;
71
- }
72
-
73
- set_site_transient( "locked_{$this->_wp_user_id}", $this->_thread_id, $expiration );
74
-
75
- if ( $this->has_lock() ) {
76
- set_site_transient( "locked_{$this->_wp_user_id}", true, $expiration );
77
-
78
- return true;
79
- }
80
-
81
- return false;
82
- }
83
-
84
- /**
85
- * Acquire lock regardless if it's already acquired by another locker or not.
86
- *
87
- * @author Vova Feldman (@svovaf)
88
- * @since 2.1.0
89
- *
90
- * @param int $expiration
91
- */
92
- function lock( $expiration = 0 ) {
93
- set_site_transient( "locked_{$this->_wp_user_id}", true, $expiration );
94
- }
95
-
96
- /**
97
- * Checks if lock is currently acquired.
98
- *
99
- * @author Vova Feldman (@svovaf)
100
- * @since 2.1.0
101
- *
102
- * @return bool
103
- */
104
- function is_locked() {
105
- return ( false !== get_site_transient( "locked_{$this->_wp_user_id}" ) );
106
- }
107
-
108
- /**
109
- * Unlock the lock.
110
- *
111
- * @author Vova Feldman (@svovaf)
112
- * @since 2.1.0
113
- */
114
- function unlock() {
115
- delete_site_transient( "locked_{$this->_wp_user_id}" );
116
- }
117
-
118
- /**
119
- * Checks if lock is currently acquired by the current locker.
120
- *
121
- * @return bool
122
- */
123
- private function has_lock() {
124
- return ( $this->_thread_id == get_site_transient( "locked_{$this->_wp_user_id}" ) );
125
- }
126
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 2.1.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_User_Lock
15
+ */
16
+ class FS_User_Lock {
17
+ /**
18
+ * @var int
19
+ */
20
+ private $_wp_user_id;
21
+ /**
22
+ * @var int
23
+ */
24
+ private $_thread_id;
25
+
26
+ #--------------------------------------------------------------------------------
27
+ #region Singleton
28
+ #--------------------------------------------------------------------------------
29
+
30
+ /**
31
+ * @var FS_User_Lock
32
+ */
33
+ private static $_instance;
34
+
35
+ /**
36
+ * @author Vova Feldman (@svovaf)
37
+ * @since 2.1.0
38
+ *
39
+ * @return FS_User_Lock
40
+ */
41
+ static function instance() {
42
+ if ( ! isset( self::$_instance ) ) {
43
+ self::$_instance = new self();
44
+ }
45
+
46
+ return self::$_instance;
47
+ }
48
+
49
+ #endregion
50
+
51
+ private function __construct() {
52
+ $this->_wp_user_id = Freemius::get_current_wp_user_id();
53
+ $this->_thread_id = mt_rand( 0, 32000 );
54
+ }
55
+
56
+
57
+ /**
58
+ * Try to acquire lock. If the lock is already set or is being acquired by another locker, don't do anything.
59
+ *
60
+ * @author Vova Feldman (@svovaf)
61
+ * @since 2.1.0
62
+ *
63
+ * @param int $expiration
64
+ *
65
+ * @return bool TRUE if successfully acquired lock.
66
+ */
67
+ function try_lock( $expiration = 0 ) {
68
+ if ( $this->is_locked() ) {
69
+ // Already locked.
70
+ return false;
71
+ }
72
+
73
+ set_site_transient( "locked_{$this->_wp_user_id}", $this->_thread_id, $expiration );
74
+
75
+ if ( $this->has_lock() ) {
76
+ set_site_transient( "locked_{$this->_wp_user_id}", true, $expiration );
77
+
78
+ return true;
79
+ }
80
+
81
+ return false;
82
+ }
83
+
84
+ /**
85
+ * Acquire lock regardless if it's already acquired by another locker or not.
86
+ *
87
+ * @author Vova Feldman (@svovaf)
88
+ * @since 2.1.0
89
+ *
90
+ * @param int $expiration
91
+ */
92
+ function lock( $expiration = 0 ) {
93
+ set_site_transient( "locked_{$this->_wp_user_id}", true, $expiration );
94
+ }
95
+
96
+ /**
97
+ * Checks if lock is currently acquired.
98
+ *
99
+ * @author Vova Feldman (@svovaf)
100
+ * @since 2.1.0
101
+ *
102
+ * @return bool
103
+ */
104
+ function is_locked() {
105
+ return ( false !== get_site_transient( "locked_{$this->_wp_user_id}" ) );
106
+ }
107
+
108
+ /**
109
+ * Unlock the lock.
110
+ *
111
+ * @author Vova Feldman (@svovaf)
112
+ * @since 2.1.0
113
+ */
114
+ function unlock() {
115
+ delete_site_transient( "locked_{$this->_wp_user_id}" );
116
+ }
117
+
118
+ /**
119
+ * Checks if lock is currently acquired by the current locker.
120
+ *
121
+ * @return bool
122
+ */
123
+ private function has_lock() {
124
+ return ( $this->_thread_id == get_site_transient( "locked_{$this->_wp_user_id}" ) );
125
+ }
126
  }
includes/pum-sdk/freemius/includes/customizer/class-fs-customizer-support-section.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.2.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class Zerif_Customizer_Theme_Info_Main
15
- *
16
- * @since 1.0.0
17
- * @access public
18
- */
19
- class FS_Customizer_Support_Section extends WP_Customize_Section {
20
-
21
- function __construct( $manager, $id, $args = array() ) {
22
- $manager->register_section_type( 'FS_Customizer_Support_Section' );
23
-
24
- parent::__construct( $manager, $id, $args );
25
- }
26
-
27
- /**
28
- * The type of customize section being rendered.
29
- *
30
- * @since 1.0.0
31
- * @access public
32
- * @var string
33
- */
34
- public $type = 'freemius-support-section';
35
-
36
- /**
37
- * @var Freemius
38
- */
39
- public $fs = null;
40
-
41
- /**
42
- * Add custom parameters to pass to the JS via JSON.
43
- *
44
- * @since 1.0.0
45
- */
46
- public function json() {
47
- $json = parent::json();
48
-
49
- $is_contact_visible = $this->fs->is_page_visible( 'contact' );
50
- $is_support_visible = $this->fs->is_page_visible( 'support' );
51
-
52
- $json['theme_title'] = $this->fs->get_plugin_name();
53
-
54
- if ( $is_contact_visible && $is_support_visible ) {
55
- $json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
56
- }
57
-
58
- if ( $is_contact_visible ) {
59
- $json['contact'] = array(
60
- 'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
61
- 'url' => $this->fs->contact_url(),
62
- );
63
- }
64
-
65
- if ( $is_support_visible ) {
66
- $json['support'] = array(
67
- 'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
68
- 'url' => $this->fs->get_support_forum_url()
69
- );
70
- }
71
-
72
- return $json;
73
- }
74
-
75
- /**
76
- * Outputs the Underscore.js template.
77
- *
78
- * @since 1.0.0
79
- */
80
- protected function render_template() {
81
- ?>
82
- <li id="fs_customizer_support"
83
- class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
84
- <h3 class="accordion-section-title">
85
- <span>{{ data.theme_title }}</span>
86
- <# if ( data.contact && data.support ) { #>
87
- <div class="button-group">
88
- <# } #>
89
- <# if ( data.contact ) { #>
90
- <a class="button" href="{{ data.contact.url }}" target="_blank">{{ data.contact.label }} </a>
91
- <# } #>
92
- <# if ( data.support ) { #>
93
- <a class="button" href="{{ data.support.url }}" target="_blank">{{ data.support.label }} </a>
94
- <# } #>
95
- <# if ( data.contact && data.support ) { #>
96
- </div>
97
- <# } #>
98
- </h3>
99
- </li>
100
- <?php
101
- }
102
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.2.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class Zerif_Customizer_Theme_Info_Main
15
+ *
16
+ * @since 1.0.0
17
+ * @access public
18
+ */
19
+ class FS_Customizer_Support_Section extends WP_Customize_Section {
20
+
21
+ function __construct( $manager, $id, $args = array() ) {
22
+ $manager->register_section_type( 'FS_Customizer_Support_Section' );
23
+
24
+ parent::__construct( $manager, $id, $args );
25
+ }
26
+
27
+ /**
28
+ * The type of customize section being rendered.
29
+ *
30
+ * @since 1.0.0
31
+ * @access public
32
+ * @var string
33
+ */
34
+ public $type = 'freemius-support-section';
35
+
36
+ /**
37
+ * @var Freemius
38
+ */
39
+ public $fs = null;
40
+
41
+ /**
42
+ * Add custom parameters to pass to the JS via JSON.
43
+ *
44
+ * @since 1.0.0
45
+ */
46
+ public function json() {
47
+ $json = parent::json();
48
+
49
+ $is_contact_visible = $this->fs->is_page_visible( 'contact' );
50
+ $is_support_visible = $this->fs->is_page_visible( 'support' );
51
+
52
+ $json['theme_title'] = $this->fs->get_plugin_name();
53
+
54
+ if ( $is_contact_visible && $is_support_visible ) {
55
+ $json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
56
+ }
57
+
58
+ if ( $is_contact_visible ) {
59
+ $json['contact'] = array(
60
+ 'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
61
+ 'url' => $this->fs->contact_url(),
62
+ );
63
+ }
64
+
65
+ if ( $is_support_visible ) {
66
+ $json['support'] = array(
67
+ 'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
68
+ 'url' => $this->fs->get_support_forum_url()
69
+ );
70
+ }
71
+
72
+ return $json;
73
+ }
74
+
75
+ /**
76
+ * Outputs the Underscore.js template.
77
+ *
78
+ * @since 1.0.0
79
+ */
80
+ protected function render_template() {
81
+ ?>
82
+ <li id="fs_customizer_support"
83
+ class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
84
+ <h3 class="accordion-section-title">
85
+ <span>{{ data.theme_title }}</span>
86
+ <# if ( data.contact && data.support ) { #>
87
+ <div class="button-group">
88
+ <# } #>
89
+ <# if ( data.contact ) { #>
90
+ <a class="button" href="{{ data.contact.url }}" target="_blank">{{ data.contact.label }} </a>
91
+ <# } #>
92
+ <# if ( data.support ) { #>
93
+ <a class="button" href="{{ data.support.url }}" target="_blank">{{ data.support.label }} </a>
94
+ <# } #>
95
+ <# if ( data.contact && data.support ) { #>
96
+ </div>
97
+ <# } #>
98
+ </h3>
99
+ </li>
100
+ <?php
101
+ }
102
  }
includes/pum-sdk/freemius/includes/customizer/class-fs-customizer-upsell-control.php CHANGED
@@ -1,157 +1,157 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.2.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Customizer_Upsell_Control
15
- */
16
- class FS_Customizer_Upsell_Control extends WP_Customize_Control {
17
-
18
- /**
19
- * Control type
20
- *
21
- * @var string control type
22
- */
23
- public $type = 'freemius-upsell-control';
24
-
25
- /**
26
- * @var Freemius
27
- */
28
- public $fs = null;
29
-
30
- /**
31
- * @param WP_Customize_Manager $manager the customize manager class.
32
- * @param string $id id.
33
- * @param array $args customizer manager parameters.
34
- */
35
- public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
36
- $manager->register_control_type( 'FS_Customizer_Upsell_Control' );
37
-
38
- parent::__construct( $manager, $id, $args );
39
- }
40
-
41
- /**
42
- * Enqueue resources for the control.
43
- */
44
- public function enqueue() {
45
- fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
46
- }
47
-
48
- /**
49
- * Json conversion
50
- */
51
- public function to_json() {
52
- $pricing_cta = esc_html( $this->fs->get_pricing_cta_label() ) . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' );
53
-
54
- parent::to_json();
55
-
56
- $this->json['button_text'] = $pricing_cta;
57
- $this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
58
- $this->fs->get_trial_url() :
59
- $this->fs->get_upgrade_url();
60
-
61
- // Load features.
62
- $pricing = $this->fs->get_api_plugin_scope()->get( 'pricing.json' );
63
-
64
- if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
65
- // Add support features.
66
- if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
67
- $support_features = array(
68
- 'kb' => 'Help Center',
69
- 'forum' => 'Support Forum',
70
- 'email' => 'Priority Email Support',
71
- 'phone' => 'Phone Support',
72
- 'skype' => 'Skype Support',
73
- 'is_success_manager' => 'Personal Success Manager',
74
- );
75
-
76
- for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
77
- if ( 'free' == $pricing->plans[$i]->name ) {
78
- continue;
79
- }
80
-
81
- if ( ! isset( $pricing->plans[ $i ]->features ) ||
82
- ! is_array( $pricing->plans[ $i ]->features ) ) {
83
- $pricing->plans[$i]->features = array();
84
- }
85
-
86
- foreach ( $support_features as $key => $label ) {
87
- $key = ( 'is_success_manager' !== $key ) ?
88
- "support_{$key}" :
89
- $key;
90
-
91
- if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
92
-
93
- $support_feature = new stdClass();
94
- $support_feature->title = $label;
95
-
96
- $pricing->plans[ $i ]->features[] = $support_feature;
97
- }
98
- }
99
- }
100
- }
101
- }
102
-
103
- $this->json['plans'] = $pricing->plans;
104
-
105
- $this->json['strings'] = array(
106
- 'plan' => $this->fs->get_text_x_inline( 'Plan', 'as product pricing plan', 'plan' ),
107
- );
108
- }
109
-
110
- /**
111
- * Control content
112
- */
113
- public function content_template() {
114
- ?>
115
- <div id="fs_customizer_upsell">
116
- <# if ( data.plans ) { #>
117
- <ul class="fs-customizer-plans">
118
- <# for (i in data.plans) { #>
119
- <# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
120
- <li class="fs-customizer-plan">
121
- <div class="fs-accordion-section-open">
122
- <h2 class="fs-accordion-section-title menu-item">
123
- <span>{{ data.plans[i].title }}</span>
124
- <button type="button" class="button-link item-edit" aria-expanded="true">
125
- <span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
126
- <span class="toggle-indicator" aria-hidden="true"></span>
127
- </button>
128
- </h2>
129
- <div class="fs-accordion-section-content">
130
- <# if ( data.plans[i].description ) { #>
131
- <h3>{{ data.plans[i].description }}</h3>
132
- <# } #>
133
- <# if ( data.plans[i].features ) { #>
134
- <ul>
135
- <# for ( j in data.plans[i].features ) { #>
136
- <li><div class="fs-feature">
137
- <span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
138
- <# if ( data.plans[i].features[j].description ) { #>
139
- <span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
140
- <# } #>
141
- </div></li>
142
- <# } #>
143
- </ul>
144
- <# } #>
145
- <# if ( 'free' != data.plans[i].name ) { #>
146
- <a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
147
- <# } #>
148
- </div>
149
- </div>
150
- </li>
151
- <# } #>
152
- <# } #>
153
- </ul>
154
- <# } #>
155
- </div>
156
- <?php }
157
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.2.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Customizer_Upsell_Control
15
+ */
16
+ class FS_Customizer_Upsell_Control extends WP_Customize_Control {
17
+
18
+ /**
19
+ * Control type
20
+ *
21
+ * @var string control type
22
+ */
23
+ public $type = 'freemius-upsell-control';
24
+
25
+ /**
26
+ * @var Freemius
27
+ */
28
+ public $fs = null;
29
+
30
+ /**
31
+ * @param WP_Customize_Manager $manager the customize manager class.
32
+ * @param string $id id.
33
+ * @param array $args customizer manager parameters.
34
+ */
35
+ public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
36
+ $manager->register_control_type( 'FS_Customizer_Upsell_Control' );
37
+
38
+ parent::__construct( $manager, $id, $args );
39
+ }
40
+
41
+ /**
42
+ * Enqueue resources for the control.
43
+ */
44
+ public function enqueue() {
45
+ fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
46
+ }
47
+
48
+ /**
49
+ * Json conversion
50
+ */
51
+ public function to_json() {
52
+ $pricing_cta = esc_html( $this->fs->get_pricing_cta_label() ) . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' );
53
+
54
+ parent::to_json();
55
+
56
+ $this->json['button_text'] = $pricing_cta;
57
+ $this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
58
+ $this->fs->get_trial_url() :
59
+ $this->fs->get_upgrade_url();
60
+
61
+ // Load features.
62
+ $pricing = $this->fs->get_api_plugin_scope()->get( $this->fs->add_show_pending( "pricing.json" ) );
63
+
64
+ if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
65
+ // Add support features.
66
+ if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
67
+ $support_features = array(
68
+ 'kb' => 'Help Center',
69
+ 'forum' => 'Support Forum',
70
+ 'email' => 'Priority Email Support',
71
+ 'phone' => 'Phone Support',
72
+ 'skype' => 'Skype Support',
73
+ 'is_success_manager' => 'Personal Success Manager',
74
+ );
75
+
76
+ for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
77
+ if ( 'free' == $pricing->plans[$i]->name ) {
78
+ continue;
79
+ }
80
+
81
+ if ( ! isset( $pricing->plans[ $i ]->features ) ||
82
+ ! is_array( $pricing->plans[ $i ]->features ) ) {
83
+ $pricing->plans[$i]->features = array();
84
+ }
85
+
86
+ foreach ( $support_features as $key => $label ) {
87
+ $key = ( 'is_success_manager' !== $key ) ?
88
+ "support_{$key}" :
89
+ $key;
90
+
91
+ if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
92
+
93
+ $support_feature = new stdClass();
94
+ $support_feature->title = $label;
95
+
96
+ $pricing->plans[ $i ]->features[] = $support_feature;
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ $this->json['plans'] = $pricing->plans;
104
+
105
+ $this->json['strings'] = array(
106
+ 'plan' => $this->fs->get_text_x_inline( 'Plan', 'as product pricing plan', 'plan' ),
107
+ );
108
+ }
109
+
110
+ /**
111
+ * Control content
112
+ */
113
+ public function content_template() {
114
+ ?>
115
+ <div id="fs_customizer_upsell">
116
+ <# if ( data.plans ) { #>
117
+ <ul class="fs-customizer-plans">
118
+ <# for (i in data.plans) { #>
119
+ <# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
120
+ <li class="fs-customizer-plan">
121
+ <div class="fs-accordion-section-open">
122
+ <h2 class="fs-accordion-section-title menu-item">
123
+ <span>{{ data.plans[i].title }}</span>
124
+ <button type="button" class="button-link item-edit" aria-expanded="true">
125
+ <span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
126
+ <span class="toggle-indicator" aria-hidden="true"></span>
127
+ </button>
128
+ </h2>
129
+ <div class="fs-accordion-section-content">
130
+ <# if ( data.plans[i].description ) { #>
131
+ <h3>{{ data.plans[i].description }}</h3>
132
+ <# } #>
133
+ <# if ( data.plans[i].features ) { #>
134
+ <ul>
135
+ <# for ( j in data.plans[i].features ) { #>
136
+ <li><div class="fs-feature">
137
+ <span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
138
+ <# if ( data.plans[i].features[j].description ) { #>
139
+ <span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
140
+ <# } #>
141
+ </div></li>
142
+ <# } #>
143
+ </ul>
144
+ <# } #>
145
+ <# if ( 'free' != data.plans[i].name ) { #>
146
+ <a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
147
+ <# } #>
148
+ </div>
149
+ </div>
150
+ </li>
151
+ <# } #>
152
+ <# } #>
153
+ </ul>
154
+ <# } #>
155
+ </div>
156
+ <?php }
157
  }
includes/pum-sdk/freemius/includes/customizer/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/debug/class-fs-debug-bar-panel.php CHANGED
@@ -1,64 +1,64 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.7.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Extends Debug Bar plugin by adding a panel to show all Freemius API requests.
15
- *
16
- * @author Vova Feldman (@svovaf)
17
- * @since 1.1.7.3
18
- *
19
- * Class Freemius_Debug_Bar_Panel
20
- */
21
- class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel {
22
- function init() {
23
- $this->title( 'Freemius' );
24
- }
25
-
26
- static function requests_count() {
27
- if ( class_exists( 'Freemius_Api_WordPress' ) ) {
28
- $logger = Freemius_Api_WordPress::GetLogger();
29
- } else {
30
- $logger = array();
31
- }
32
-
33
- return number_format( count( $logger ) );
34
- }
35
-
36
- static function total_time() {
37
- if ( class_exists( 'Freemius_Api_WordPress' ) ) {
38
- $logger = Freemius_Api_WordPress::GetLogger();
39
- } else {
40
- $logger = array();
41
- }
42
-
43
- $total_time = .0;
44
- foreach ( $logger as $l ) {
45
- $total_time += $l['total'];
46
- }
47
-
48
- return number_format( 100 * $total_time, 2 ) . ' ' . fs_text_x_inline( 'ms', 'milliseconds' );
49
- }
50
-
51
- function render() {
52
- ?>
53
- <div id='debug-bar-php'>
54
- <?php fs_require_template( '/debug/api-calls.php' ) ?>
55
- <br>
56
- <?php fs_require_template( '/debug/scheduled-crons.php' ) ?>
57
- <br>
58
- <?php fs_require_template( '/debug/plugins-themes-sync.php' ) ?>
59
- <br>
60
- <?php fs_require_template( '/debug/logger.php' ) ?>
61
- </div>
62
- <?php
63
- }
64
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.7.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Extends Debug Bar plugin by adding a panel to show all Freemius API requests.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.1.7.3
18
+ *
19
+ * Class Freemius_Debug_Bar_Panel
20
+ */
21
+ class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel {
22
+ function init() {
23
+ $this->title( 'Freemius' );
24
+ }
25
+
26
+ static function requests_count() {
27
+ if ( class_exists( 'Freemius_Api_WordPress' ) ) {
28
+ $logger = Freemius_Api_WordPress::GetLogger();
29
+ } else {
30
+ $logger = array();
31
+ }
32
+
33
+ return number_format( count( $logger ) );
34
+ }
35
+
36
+ static function total_time() {
37
+ if ( class_exists( 'Freemius_Api_WordPress' ) ) {
38
+ $logger = Freemius_Api_WordPress::GetLogger();
39
+ } else {
40
+ $logger = array();
41
+ }
42
+
43
+ $total_time = .0;
44
+ foreach ( $logger as $l ) {
45
+ $total_time += $l['total'];
46
+ }
47
+
48
+ return number_format( 100 * $total_time, 2 ) . ' ' . fs_text_x_inline( 'ms', 'milliseconds' );
49
+ }
50
+
51
+ function render() {
52
+ ?>
53
+ <div id='debug-bar-php'>
54
+ <?php fs_require_template( '/debug/api-calls.php' ) ?>
55
+ <br>
56
+ <?php fs_require_template( '/debug/scheduled-crons.php' ) ?>
57
+ <br>
58
+ <?php fs_require_template( '/debug/plugins-themes-sync.php' ) ?>
59
+ <br>
60
+ <?php fs_require_template( '/debug/logger.php' ) ?>
61
+ </div>
62
+ <?php
63
+ }
64
+ }
includes/pum-sdk/freemius/includes/debug/debug-bar-start.php CHANGED
@@ -1,52 +1,52 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.7.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- if ( ! WP_FS__DEBUG_SDK ) {
14
- return;
15
- }
16
-
17
- /**
18
- * Initialize Freemius custom debug panels.
19
- *
20
- * @param array $panels Debug bar panels objects
21
- *
22
- * @return array Debug bar panels with your custom panels
23
- */
24
- function fs_custom_panels_init( $panels ) {
25
- if ( class_exists( 'Debug_Bar_Panel' ) ) {
26
- if ( FS_API__LOGGER_ON ) {
27
- require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
28
- $panels[] = new Freemius_Debug_Bar_Panel();
29
- }
30
- }
31
-
32
- return $panels;
33
- }
34
-
35
- function fs_custom_status_init( $statuses ) {
36
- if ( class_exists( 'Debug_Bar_Panel' ) ) {
37
- if ( FS_API__LOGGER_ON ) {
38
- require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
39
- $statuses[] = array(
40
- 'fs_api_requests',
41
- fs_text_inline( 'Freemius API' ),
42
- Freemius_Debug_Bar_Panel::requests_count() . ' ' . fs_text_inline( 'Requests' ) .
43
- ' (' . Freemius_Debug_Bar_Panel::total_time() . ')'
44
- );
45
- }
46
- }
47
-
48
- return $statuses;
49
- }
50
-
51
- add_filter( 'debug_bar_panels', 'fs_custom_panels_init' );
52
  add_filter( 'debug_bar_statuses', 'fs_custom_status_init' );
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.7.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( ! WP_FS__DEBUG_SDK ) {
14
+ return;
15
+ }
16
+
17
+ /**
18
+ * Initialize Freemius custom debug panels.
19
+ *
20
+ * @param array $panels Debug bar panels objects
21
+ *
22
+ * @return array Debug bar panels with your custom panels
23
+ */
24
+ function fs_custom_panels_init( $panels ) {
25
+ if ( class_exists( 'Debug_Bar_Panel' ) ) {
26
+ if ( FS_API__LOGGER_ON ) {
27
+ require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
28
+ $panels[] = new Freemius_Debug_Bar_Panel();
29
+ }
30
+ }
31
+
32
+ return $panels;
33
+ }
34
+
35
+ function fs_custom_status_init( $statuses ) {
36
+ if ( class_exists( 'Debug_Bar_Panel' ) ) {
37
+ if ( FS_API__LOGGER_ON ) {
38
+ require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
39
+ $statuses[] = array(
40
+ 'fs_api_requests',
41
+ fs_text_inline( 'Freemius API' ),
42
+ Freemius_Debug_Bar_Panel::requests_count() . ' ' . fs_text_inline( 'Requests' ) .
43
+ ' (' . Freemius_Debug_Bar_Panel::total_time() . ')'
44
+ );
45
+ }
46
+ }
47
+
48
+ return $statuses;
49
+ }
50
+
51
+ add_filter( 'debug_bar_panels', 'fs_custom_panels_init' );
52
  add_filter( 'debug_bar_statuses', 'fs_custom_status_init' );
includes/pum-sdk/freemius/includes/debug/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/entities/class-fs-affiliate-terms.php CHANGED
@@ -1,128 +1,128 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_AffiliateTerms extends FS_Scope_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var bool
19
- */
20
- public $is_active;
21
- /**
22
- * @var string Enum: `affiliation` or `rewards`. Defaults to `affiliation`.
23
- */
24
- public $type;
25
- /**
26
- * @var string Enum: `payout` or `credit`. Defaults to `payout`.
27
- */
28
- public $reward_type;
29
- /**
30
- * If `first`, the referral will be attributed to the first visited source containing the affiliation link that
31
- * was clicked.
32
- *
33
- * @var string Enum: `first` or `last`. Defaults to `first`.
34
- */
35
- public $referral_attribution;
36
- /**
37
- * @var int Defaults to `30`, `0` for session cookie, and `null` for endless cookie (until cookies are cleaned).
38
- */
39
- public $cookie_days;
40
- /**
41
- * @var int
42
- */
43
- public $commission;
44
- /**
45
- * @var string Enum: `percentage` or `dollar`. Defaults to `percentage`.
46
- */
47
- public $commission_type;
48
- /**
49
- * @var null|int Defaults to `0` (affiliate only on first payment). `null` for commission for all renewals. If
50
- * greater than `0`, affiliate will get paid for all renewals for `commission_renewals_days` days after
51
- * the initial upgrade/purchase.
52
- */
53
- public $commission_renewals_days;
54
- /**
55
- * @var int Only cents and no percentage. In US cents, e.g.: 100 = $1.00. Defaults to `null`.
56
- */
57
- public $install_commission;
58
- /**
59
- * @var string Required default target link, e.g.: pricing page.
60
- */
61
- public $default_url;
62
- /**
63
- * @var string One of the following: 'all', 'new_customer', 'new_user'.
64
- * If 'all' - reward for any user type.
65
- * If 'new_customer' - reward only for new customers.
66
- * If 'new_user' - reward only for new users.
67
- */
68
- public $reward_customer_type;
69
- /**
70
- * @var int Defaults to `0` (affiliate only on directly affiliated links). `null` if an affiliate will get
71
- * paid for all customers' lifetime payments. If greater than `0`, an affiliate will get paid for all
72
- * customer payments for `future_payments_days` days after the initial payment.
73
- */
74
- public $future_payments_days;
75
- /**
76
- * @var bool If `true`, allow referrals from social sites.
77
- */
78
- public $is_social_allowed;
79
- /**
80
- * @var bool If `true`, allow conversions without HTTP referrer header at all.
81
- */
82
- public $is_app_allowed;
83
- /**
84
- * @var bool If `true`, allow referrals from any site.
85
- */
86
- public $is_any_site_allowed;
87
-
88
- #endregion Properties
89
-
90
- /**
91
- * @author Leo Fajardo (@leorw)
92
- *
93
- * @return string
94
- */
95
- function get_formatted_commission()
96
- {
97
- return ( 'dollar' === $this->commission_type ) ?
98
- ( '$' . $this->commission ) :
99
- ( $this->commission . '%' );
100
- }
101
-
102
- /**
103
- * @author Leo Fajardo (@leorw)
104
- *
105
- * @return bool
106
- */
107
- function has_lifetime_commission() {
108
- return ( 0 !== $this->future_payments_days );
109
- }
110
-
111
- /**
112
- * @author Leo Fajardo (@leorw)
113
- *
114
- * @return bool
115
- */
116
- function is_session_cookie() {
117
- return ( 0 == $this->cookie_days );
118
- }
119
-
120
- /**
121
- * @author Leo Fajardo (@leorw)
122
- *
123
- * @return bool
124
- */
125
- function has_renewals_commission() {
126
- return ( is_null( $this->commission_renewals_days ) || $this->commission_renewals_days > 0 );
127
- }
128
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_AffiliateTerms extends FS_Scope_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var bool
19
+ */
20
+ public $is_active;
21
+ /**
22
+ * @var string Enum: `affiliation` or `rewards`. Defaults to `affiliation`.
23
+ */
24
+ public $type;
25
+ /**
26
+ * @var string Enum: `payout` or `credit`. Defaults to `payout`.
27
+ */
28
+ public $reward_type;
29
+ /**
30
+ * If `first`, the referral will be attributed to the first visited source containing the affiliation link that
31
+ * was clicked.
32
+ *
33
+ * @var string Enum: `first` or `last`. Defaults to `first`.
34
+ */
35
+ public $referral_attribution;
36
+ /**
37
+ * @var int Defaults to `30`, `0` for session cookie, and `null` for endless cookie (until cookies are cleaned).
38
+ */
39
+ public $cookie_days;
40
+ /**
41
+ * @var int
42
+ */
43
+ public $commission;
44
+ /**
45
+ * @var string Enum: `percentage` or `dollar`. Defaults to `percentage`.
46
+ */
47
+ public $commission_type;
48
+ /**
49
+ * @var null|int Defaults to `0` (affiliate only on first payment). `null` for commission for all renewals. If
50
+ * greater than `0`, affiliate will get paid for all renewals for `commission_renewals_days` days after
51
+ * the initial upgrade/purchase.
52
+ */
53
+ public $commission_renewals_days;
54
+ /**
55
+ * @var int Only cents and no percentage. In US cents, e.g.: 100 = $1.00. Defaults to `null`.
56
+ */
57
+ public $install_commission;
58
+ /**
59
+ * @var string Required default target link, e.g.: pricing page.
60
+ */
61
+ public $default_url;
62
+ /**
63
+ * @var string One of the following: 'all', 'new_customer', 'new_user'.
64
+ * If 'all' - reward for any user type.
65
+ * If 'new_customer' - reward only for new customers.
66
+ * If 'new_user' - reward only for new users.
67
+ */
68
+ public $reward_customer_type;
69
+ /**
70
+ * @var int Defaults to `0` (affiliate only on directly affiliated links). `null` if an affiliate will get
71
+ * paid for all customers' lifetime payments. If greater than `0`, an affiliate will get paid for all
72
+ * customer payments for `future_payments_days` days after the initial payment.
73
+ */
74
+ public $future_payments_days;
75
+ /**
76
+ * @var bool If `true`, allow referrals from social sites.
77
+ */
78
+ public $is_social_allowed;
79
+ /**
80
+ * @var bool If `true`, allow conversions without HTTP referrer header at all.
81
+ */
82
+ public $is_app_allowed;
83
+ /**
84
+ * @var bool If `true`, allow referrals from any site.
85
+ */
86
+ public $is_any_site_allowed;
87
+
88
+ #endregion Properties
89
+
90
+ /**
91
+ * @author Leo Fajardo (@leorw)
92
+ *
93
+ * @return string
94
+ */
95
+ function get_formatted_commission()
96
+ {
97
+ return ( 'dollar' === $this->commission_type ) ?
98
+ ( '$' . $this->commission ) :
99
+ ( $this->commission . '%' );
100
+ }
101
+
102
+ /**
103
+ * @author Leo Fajardo (@leorw)
104
+ *
105
+ * @return bool
106
+ */
107
+ function has_lifetime_commission() {
108
+ return ( 0 !== $this->future_payments_days );
109
+ }
110
+
111
+ /**
112
+ * @author Leo Fajardo (@leorw)
113
+ *
114
+ * @return bool
115
+ */
116
+ function is_session_cookie() {
117
+ return ( 0 == $this->cookie_days );
118
+ }
119
+
120
+ /**
121
+ * @author Leo Fajardo (@leorw)
122
+ *
123
+ * @return bool
124
+ */
125
+ function has_renewals_commission() {
126
+ return ( is_null( $this->commission_renewals_days ) || $this->commission_renewals_days > 0 );
127
+ }
128
  }
includes/pum-sdk/freemius/includes/entities/class-fs-affiliate.php CHANGED
@@ -1,84 +1,84 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Affiliate extends FS_Scope_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var string
19
- */
20
- public $paypal_email;
21
- /**
22
- * @var number
23
- */
24
- public $custom_affiliate_terms_id;
25
- /**
26
- * @var boolean
27
- */
28
- public $is_using_custom_terms;
29
- /**
30
- * @var string status Enum: `pending`, `rejected`, `suspended`, or `active`. Defaults to `pending`.
31
- */
32
- public $status;
33
- /**
34
- * @var string
35
- */
36
- public $domain;
37
-
38
- #endregion Properties
39
-
40
- /**
41
- * @author Leo Fajardo
42
- *
43
- * @return bool
44
- */
45
- function is_active() {
46
- return ( 'active' === $this->status );
47
- }
48
-
49
- /**
50
- * @author Leo Fajardo
51
- *
52
- * @return bool
53
- */
54
- function is_pending() {
55
- return ( 'pending' === $this->status );
56
- }
57
-
58
- /**
59
- * @author Leo Fajardo
60
- *
61
- * @return bool
62
- */
63
- function is_suspended() {
64
- return ( 'suspended' === $this->status );
65
- }
66
-
67
- /**
68
- * @author Leo Fajardo
69
- *
70
- * @return bool
71
- */
72
- function is_rejected() {
73
- return ( 'rejected' === $this->status );
74
- }
75
-
76
- /**
77
- * @author Leo Fajardo
78
- *
79
- * @return bool
80
- */
81
- function is_blocked() {
82
- return ( 'blocked' === $this->status );
83
- }
84
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Affiliate extends FS_Scope_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var string
19
+ */
20
+ public $paypal_email;
21
+ /**
22
+ * @var number
23
+ */
24
+ public $custom_affiliate_terms_id;
25
+ /**
26
+ * @var boolean
27
+ */
28
+ public $is_using_custom_terms;
29
+ /**
30
+ * @var string status Enum: `pending`, `rejected`, `suspended`, or `active`. Defaults to `pending`.
31
+ */
32
+ public $status;
33
+ /**
34
+ * @var string
35
+ */
36
+ public $domain;
37
+
38
+ #endregion Properties
39
+
40
+ /**
41
+ * @author Leo Fajardo
42
+ *
43
+ * @return bool
44
+ */
45
+ function is_active() {
46
+ return ( 'active' === $this->status );
47
+ }
48
+
49
+ /**
50
+ * @author Leo Fajardo
51
+ *
52
+ * @return bool
53
+ */
54
+ function is_pending() {
55
+ return ( 'pending' === $this->status );
56
+ }
57
+
58
+ /**
59
+ * @author Leo Fajardo
60
+ *
61
+ * @return bool
62
+ */
63
+ function is_suspended() {
64
+ return ( 'suspended' === $this->status );
65
+ }
66
+
67
+ /**
68
+ * @author Leo Fajardo
69
+ *
70
+ * @return bool
71
+ */
72
+ function is_rejected() {
73
+ return ( 'rejected' === $this->status );
74
+ }
75
+
76
+ /**
77
+ * @author Leo Fajardo
78
+ *
79
+ * @return bool
80
+ */
81
+ function is_blocked() {
82
+ return ( 'blocked' === $this->status );
83
+ }
84
  }
includes/pum-sdk/freemius/includes/entities/class-fs-billing.php CHANGED
@@ -1,95 +1,95 @@
1
- <?php
2
- /**
3
- * @package Freemius for EDD Add-On
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Billing extends FS_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var int
19
- */
20
- public $entity_id;
21
- /**
22
- * @var string (Enum) Linked entity type. One of: developer, plugin, user, install
23
- */
24
- public $entity_type;
25
- /**
26
- * @var string
27
- */
28
- public $business_name;
29
- /**
30
- * @var string
31
- */
32
- public $first;
33
- /**
34
- * @var string
35
- */
36
- public $last;
37
- /**
38
- * @var string
39
- */
40
- public $email;
41
- /**
42
- * @var string
43
- */
44
- public $phone;
45
- /**
46
- * @var string
47
- */
48
- public $website;
49
- /**
50
- * @var string Tax or VAT ID.
51
- */
52
- public $tax_id;
53
- /**
54
- * @var string
55
- */
56
- public $address_street;
57
- /**
58
- * @var string
59
- */
60
- public $address_apt;
61
- /**
62
- * @var string
63
- */
64
- public $address_city;
65
- /**
66
- * @var string
67
- */
68
- public $address_country;
69
- /**
70
- * @var string Two chars country code.
71
- */
72
- public $address_country_code;
73
- /**
74
- * @var string
75
- */
76
- public $address_state;
77
- /**
78
- * @var number Numeric ZIP code (cab be with leading zeros).
79
- */
80
- public $address_zip;
81
-
82
- #endregion Properties
83
-
84
-
85
- /**
86
- * @param object|bool $event
87
- */
88
- function __construct( $event = false ) {
89
- parent::__construct( $event );
90
- }
91
-
92
- static function get_type() {
93
- return 'billing';
94
- }
95
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius for EDD Add-On
4
+ * @copyright Copyright (c) 2016, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Billing extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var int
19
+ */
20
+ public $entity_id;
21
+ /**
22
+ * @var string (Enum) Linked entity type. One of: developer, plugin, user, install
23
+ */
24
+ public $entity_type;
25
+ /**
26
+ * @var string
27
+ */
28
+ public $business_name;
29
+ /**
30
+ * @var string
31
+ */
32
+ public $first;
33
+ /**
34
+ * @var string
35
+ */
36
+ public $last;
37
+ /**
38
+ * @var string
39
+ */
40
+ public $email;
41
+ /**
42
+ * @var string
43
+ */
44
+ public $phone;
45
+ /**
46
+ * @var string
47
+ */
48
+ public $website;
49
+ /**
50
+ * @var string Tax or VAT ID.
51
+ */
52
+ public $tax_id;
53
+ /**
54
+ * @var string
55
+ */
56
+ public $address_street;
57
+ /**
58
+ * @var string
59
+ */
60
+ public $address_apt;
61
+ /**
62
+ * @var string
63
+ */
64
+ public $address_city;
65
+ /**
66
+ * @var string
67
+ */
68
+ public $address_country;
69
+ /**
70
+ * @var string Two chars country code.
71
+ */
72
+ public $address_country_code;
73
+ /**
74
+ * @var string
75
+ */
76
+ public $address_state;
77
+ /**
78
+ * @var number Numeric ZIP code (cab be with leading zeros).
79
+ */
80
+ public $address_zip;
81
+
82
+ #endregion Properties
83
+
84
+
85
+ /**
86
+ * @param object|bool $event
87
+ */
88
+ function __construct( $event = false ) {
89
+ parent::__construct( $event );
90
+ }
91
+
92
+ static function get_type() {
93
+ return 'billing';
94
+ }
95
  }
includes/pum-sdk/freemius/includes/entities/class-fs-entity.php CHANGED
@@ -1,149 +1,149 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Get object's public variables.
15
- *
16
- * @author Vova Feldman (@svovaf)
17
- * @since 1.0.0
18
- *
19
- * @param object $object
20
- *
21
- * @return array
22
- */
23
- function fs_get_object_public_vars( $object ) {
24
- return get_object_vars( $object );
25
- }
26
-
27
- class FS_Entity {
28
- /**
29
- * @var number
30
- */
31
- public $id;
32
- /**
33
- * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
34
- */
35
- public $updated;
36
- /**
37
- * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
38
- */
39
- public $created;
40
-
41
- /**
42
- * @param bool|object $entity
43
- */
44
- function __construct( $entity = false ) {
45
- if ( ! ( $entity instanceof stdClass ) && ! ( $entity instanceof FS_Entity ) ) {
46
- return;
47
- }
48
-
49
- $props = fs_get_object_public_vars( $this );
50
-
51
- foreach ( $props as $key => $def_value ) {
52
- $this->{$key} = isset( $entity->{$key} ) ?
53
- $entity->{$key} :
54
- $def_value;
55
- }
56
- }
57
-
58
- static function get_type() {
59
- return 'type';
60
- }
61
-
62
- /**
63
- * @author Vova Feldman (@svovaf)
64
- * @since 1.0.6
65
- *
66
- * @param FS_Entity $entity1
67
- * @param FS_Entity $entity2
68
- *
69
- * @return bool
70
- */
71
- static function equals( $entity1, $entity2 ) {
72
- if ( is_null( $entity1 ) && is_null( $entity2 ) ) {
73
- return true;
74
- } else if ( is_object( $entity1 ) && is_object( $entity2 ) ) {
75
- return ( $entity1->id == $entity2->id );
76
- } else if ( is_object( $entity1 ) ) {
77
- return is_null( $entity1->id );
78
- } else {
79
- return is_null( $entity2->id );
80
- }
81
- }
82
-
83
- private $_is_updated = false;
84
-
85
- /**
86
- * Update object property.
87
- *
88
- * @author Vova Feldman (@svovaf)
89
- * @since 1.0.9
90
- *
91
- * @param string|array[string]mixed $key
92
- * @param string|bool $val
93
- *
94
- * @return bool
95
- */
96
- function update( $key, $val = false ) {
97
- if ( ! is_array( $key ) ) {
98
- $key = array( $key => $val );
99
- }
100
-
101
- $is_updated = false;
102
-
103
- foreach ( $key as $k => $v ) {
104
- if ( $this->{$k} === $v ) {
105
- continue;
106
- }
107
-
108
- if ( ( is_string( $this->{$k} ) && is_numeric( $v ) ||
109
- ( is_numeric( $this->{$k} ) && is_string( $v ) ) ) &&
110
- $this->{$k} == $v
111
- ) {
112
- continue;
113
- }
114
-
115
- // Update value.
116
- $this->{$k} = $v;
117
-
118
- $is_updated = true;
119
- }
120
-
121
- $this->_is_updated = $is_updated;
122
-
123
- return $is_updated;
124
- }
125
-
126
- /**
127
- * Checks if entity was updated.
128
- *
129
- * @author Vova Feldman (@svovaf)
130
- * @since 1.0.9
131
- *
132
- * @return bool
133
- */
134
- function is_updated() {
135
- return $this->_is_updated;
136
- }
137
-
138
- /**
139
- * @param $id
140
- *
141
- * @author Vova Feldman (@svovaf)
142
- * @since 1.1.2
143
- *
144
- * @return bool
145
- */
146
- static function is_valid_id($id){
147
- return is_numeric($id);
148
- }
149
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Get object's public variables.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.0.0
18
+ *
19
+ * @param object $object
20
+ *
21
+ * @return array
22
+ */
23
+ function fs_get_object_public_vars( $object ) {
24
+ return get_object_vars( $object );
25
+ }
26
+
27
+ class FS_Entity {
28
+ /**
29
+ * @var number
30
+ */
31
+ public $id;
32
+ /**
33
+ * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
34
+ */
35
+ public $updated;
36
+ /**
37
+ * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
38
+ */
39
+ public $created;
40
+
41
+ /**
42
+ * @param bool|object $entity
43
+ */
44
+ function __construct( $entity = false ) {
45
+ if ( ! ( $entity instanceof stdClass ) && ! ( $entity instanceof FS_Entity ) ) {
46
+ return;
47
+ }
48
+
49
+ $props = fs_get_object_public_vars( $this );
50
+
51
+ foreach ( $props as $key => $def_value ) {
52
+ $this->{$key} = isset( $entity->{$key} ) ?
53
+ $entity->{$key} :
54
+ $def_value;
55
+ }
56
+ }
57
+
58
+ static function get_type() {
59
+ return 'type';
60
+ }
61
+
62
+ /**
63
+ * @author Vova Feldman (@svovaf)
64
+ * @since 1.0.6
65
+ *
66
+ * @param FS_Entity $entity1
67
+ * @param FS_Entity $entity2
68
+ *
69
+ * @return bool
70
+ */
71
+ static function equals( $entity1, $entity2 ) {
72
+ if ( is_null( $entity1 ) && is_null( $entity2 ) ) {
73
+ return true;
74
+ } else if ( is_object( $entity1 ) && is_object( $entity2 ) ) {
75
+ return ( $entity1->id == $entity2->id );
76
+ } else if ( is_object( $entity1 ) ) {
77
+ return is_null( $entity1->id );
78
+ } else {
79
+ return is_null( $entity2->id );
80
+ }
81
+ }
82
+
83
+ private $_is_updated = false;
84
+
85
+ /**
86
+ * Update object property.
87
+ *
88
+ * @author Vova Feldman (@svovaf)
89
+ * @since 1.0.9
90
+ *
91
+ * @param string|array[string]mixed $key
92
+ * @param string|bool $val
93
+ *
94
+ * @return bool
95
+ */
96
+ function update( $key, $val = false ) {
97
+ if ( ! is_array( $key ) ) {
98
+ $key = array( $key => $val );
99
+ }
100
+
101
+ $is_updated = false;
102
+
103
+ foreach ( $key as $k => $v ) {
104
+ if ( $this->{$k} === $v ) {
105
+ continue;
106
+ }
107
+
108
+ if ( ( is_string( $this->{$k} ) && is_numeric( $v ) ||
109
+ ( is_numeric( $this->{$k} ) && is_string( $v ) ) ) &&
110
+ $this->{$k} == $v
111
+ ) {
112
+ continue;
113
+ }
114
+
115
+ // Update value.
116
+ $this->{$k} = $v;
117
+
118
+ $is_updated = true;
119
+ }
120
+
121
+ $this->_is_updated = $is_updated;
122
+
123
+ return $is_updated;
124
+ }
125
+
126
+ /**
127
+ * Checks if entity was updated.
128
+ *
129
+ * @author Vova Feldman (@svovaf)
130
+ * @since 1.0.9
131
+ *
132
+ * @return bool
133
+ */
134
+ function is_updated() {
135
+ return $this->_is_updated;
136
+ }
137
+
138
+ /**
139
+ * @param $id
140
+ *
141
+ * @author Vova Feldman (@svovaf)
142
+ * @since 1.1.2
143
+ *
144
+ * @return bool
145
+ */
146
+ static function is_valid_id($id){
147
+ return is_numeric($id);
148
+ }
149
  }
includes/pum-sdk/freemius/includes/entities/class-fs-payment.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Payment extends FS_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var number
19
- */
20
- public $plugin_id;
21
- /**
22
- * @var number
23
- */
24
- public $user_id;
25
- /**
26
- * @var number
27
- */
28
- public $install_id;
29
- /**
30
- * @var number
31
- */
32
- public $subscription_id;
33
- /**
34
- * @var number
35
- */
36
- public $plan_id;
37
- /**
38
- * @var number
39
- */
40
- public $license_id;
41
- /**
42
- * @var float
43
- */
44
- public $gross;
45
- /**
46
- * @var number
47
- */
48
- public $bound_payment_id;
49
- /**
50
- * @var string
51
- */
52
- public $external_id;
53
- /**
54
- * @var string
55
- */
56
- public $gateway;
57
- /**
58
- * @var string ISO 3166-1 alpha-2 - two-letter country code.
59
- *
60
- * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
61
- */
62
- public $country_code;
63
- /**
64
- * @var string
65
- */
66
- public $vat_id;
67
- /**
68
- * @var float Actual Tax / VAT in $$$
69
- */
70
- public $vat;
71
- /**
72
- * @var int Payment source.
73
- */
74
- public $source = 0;
75
-
76
- #endregion Properties
77
-
78
- /**
79
- * @param object|bool $payment
80
- */
81
- function __construct( $payment = false ) {
82
- parent::__construct( $payment );
83
- }
84
-
85
- static function get_type() {
86
- return 'payment';
87
- }
88
-
89
- /**
90
- * @author Vova Feldman (@svovaf)
91
- * @since 1.0.0
92
- *
93
- * @return bool
94
- */
95
- function is_refund() {
96
- return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
97
- }
98
-
99
- /**
100
- * Checks if the payment was migrated from another platform.
101
- *
102
- * @author Vova Feldman (@svovaf)
103
- * @since 2.0.2
104
- *
105
- * @return bool
106
- */
107
- function is_migrated() {
108
- return ( 0 != $this->source );
109
- }
110
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2016, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Payment extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $plugin_id;
21
+ /**
22
+ * @var number
23
+ */
24
+ public $user_id;
25
+ /**
26
+ * @var number
27
+ */
28
+ public $install_id;
29
+ /**
30
+ * @var number
31
+ */
32
+ public $subscription_id;
33
+ /**
34
+ * @var number
35
+ */
36
+ public $plan_id;
37
+ /**
38
+ * @var number
39
+ */
40
+ public $license_id;
41
+ /**
42
+ * @var float
43
+ */
44
+ public $gross;
45
+ /**
46
+ * @var number
47
+ */
48
+ public $bound_payment_id;
49
+ /**
50
+ * @var string
51
+ */
52
+ public $external_id;
53
+ /**
54
+ * @var string
55
+ */
56
+ public $gateway;
57
+ /**
58
+ * @var string ISO 3166-1 alpha-2 - two-letter country code.
59
+ *
60
+ * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
61
+ */
62
+ public $country_code;
63
+ /**
64
+ * @var string
65
+ */
66
+ public $vat_id;
67
+ /**
68
+ * @var float Actual Tax / VAT in $$$
69
+ */
70
+ public $vat;
71
+ /**
72
+ * @var int Payment source.
73
+ */
74
+ public $source = 0;
75
+
76
+ #endregion Properties
77
+
78
+ /**
79
+ * @param object|bool $payment
80
+ */
81
+ function __construct( $payment = false ) {
82
+ parent::__construct( $payment );
83
+ }
84
+
85
+ static function get_type() {
86
+ return 'payment';
87
+ }
88
+
89
+ /**
90
+ * @author Vova Feldman (@svovaf)
91
+ * @since 1.0.0
92
+ *
93
+ * @return bool
94
+ */
95
+ function is_refund() {
96
+ return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
97
+ }
98
+
99
+ /**
100
+ * Checks if the payment was migrated from another platform.
101
+ *
102
+ * @author Vova Feldman (@svovaf)
103
+ * @since 2.0.2
104
+ *
105
+ * @return bool
106
+ */
107
+ function is_migrated() {
108
+ return ( 0 != $this->source );
109
+ }
110
  }
includes/pum-sdk/freemius/includes/entities/class-fs-plugin-info.php CHANGED
@@ -1,34 +1,34 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Plugin_Info extends FS_Entity {
14
- public $plugin_id;
15
- public $description;
16
- public $short_description;
17
- public $banner_url;
18
- public $card_banner_url;
19
- public $selling_point_0;
20
- public $selling_point_1;
21
- public $selling_point_2;
22
- public $screenshots;
23
-
24
- /**
25
- * @param stdClass|bool $plugin_info
26
- */
27
- function __construct( $plugin_info = false ) {
28
- parent::__construct( $plugin_info );
29
- }
30
-
31
- static function get_type() {
32
- return 'plugin';
33
- }
34
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin_Info extends FS_Entity {
14
+ public $plugin_id;
15
+ public $description;
16
+ public $short_description;
17
+ public $banner_url;
18
+ public $card_banner_url;
19
+ public $selling_point_0;
20
+ public $selling_point_1;
21
+ public $selling_point_2;
22
+ public $screenshots;
23
+
24
+ /**
25
+ * @param stdClass|bool $plugin_info
26
+ */
27
+ function __construct( $plugin_info = false ) {
28
+ parent::__construct( $plugin_info );
29
+ }
30
+
31
+ static function get_type() {
32
+ return 'plugin';
33
+ }
34
  }
includes/pum-sdk/freemius/includes/entities/class-fs-plugin-license.php CHANGED
@@ -1,269 +1,269 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.5
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Plugin_License
15
- */
16
- class FS_Plugin_License extends FS_Entity {
17
-
18
- #region Properties
19
-
20
- /**
21
- * @var number
22
- */
23
- public $plugin_id;
24
- /**
25
- * @var number
26
- */
27
- public $user_id;
28
- /**
29
- * @var number
30
- */
31
- public $plan_id;
32
- /**
33
- * @var number
34
- */
35
- public $pricing_id;
36
- /**
37
- * @var int|null
38
- */
39
- public $quota;
40
- /**
41
- * @var int
42
- */
43
- public $activated;
44
- /**
45
- * @var int
46
- */
47
- public $activated_local;
48
- /**
49
- * @var string
50
- */
51
- public $expiration;
52
- /**
53
- * @var string
54
- */
55
- public $secret_key;
56
- /**
57
- * @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
58
- * license.
59
- */
60
- public $is_free_localhost;
61
- /**
62
- * @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
63
- * block updates and support.
64
- */
65
- public $is_block_features;
66
- /**
67
- * @var bool
68
- */
69
- public $is_cancelled;
70
-
71
- #endregion Properties
72
-
73
- /**
74
- * @param stdClass|bool $license
75
- */
76
- function __construct( $license = false ) {
77
- parent::__construct( $license );
78
- }
79
-
80
- /**
81
- * Get entity type.
82
- *
83
- * @return string
84
- */
85
- static function get_type() {
86
- return 'license';
87
- }
88
-
89
- /**
90
- * Check how many site activations left.
91
- *
92
- * @author Vova Feldman (@svovaf)
93
- * @since 1.0.5
94
- *
95
- * @return int
96
- */
97
- function left() {
98
- if ( ! $this->is_active() || $this->is_expired() ) {
99
- return 0;
100
- }
101
-
102
- if ( $this->is_unlimited() ) {
103
- return 999;
104
- }
105
-
106
- return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
107
- }
108
-
109
- /**
110
- * Check if single site license.
111
- *
112
- * @author Vova Feldman (@svovaf)
113
- * @since 1.1.8.1
114
- *
115
- * @return bool
116
- */
117
- function is_single_site() {
118
- return ( is_numeric( $this->quota ) && 1 == $this->quota );
119
- }
120
-
121
- /**
122
- * @author Vova Feldman (@svovaf)
123
- * @since 1.0.5
124
- *
125
- * @return bool
126
- */
127
- function is_expired() {
128
- return ! $this->is_lifetime() && ( strtotime( $this->expiration ) < WP_FS__SCRIPT_START_TIME );
129
- }
130
-
131
- /**
132
- * Check if license is not expired.
133
- *
134
- * @author Vova Feldman (@svovaf)
135
- * @since 1.2.1
136
- *
137
- * @return bool
138
- */
139
- function is_valid() {
140
- return ! $this->is_expired();
141
- }
142
-
143
- /**
144
- * @author Vova Feldman (@svovaf)
145
- * @since 1.0.6
146
- *
147
- * @return bool
148
- */
149
- function is_lifetime() {
150
- return is_null( $this->expiration );
151
- }
152
-
153
- /**
154
- * @author Vova Feldman (@svovaf)
155
- * @since 1.2.0
156
- *
157
- * @return bool
158
- */
159
- function is_unlimited() {
160
- return is_null( $this->quota );
161
- }
162
-
163
- /**
164
- * Check if license is fully utilized.
165
- *
166
- * @author Vova Feldman (@svovaf)
167
- * @since 1.0.6
168
- *
169
- * @param bool|null $is_localhost
170
- *
171
- * @return bool
172
- */
173
- function is_utilized( $is_localhost = null ) {
174
- if ( is_null( $is_localhost ) ) {
175
- $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
176
- }
177
-
178
- if ( $this->is_unlimited() ) {
179
- return false;
180
- }
181
-
182
- return ! ( $this->is_free_localhost && $is_localhost ) &&
183
- ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
184
- }
185
-
186
- /**
187
- * Check if license can be activated.
188
- *
189
- * @author Vova Feldman (@svovaf)
190
- * @since 2.0.0
191
- *
192
- * @param bool|null $is_localhost
193
- *
194
- * @return bool
195
- */
196
- function can_activate( $is_localhost = null ) {
197
- return ! $this->is_utilized( $is_localhost ) && $this->is_features_enabled();
198
- }
199
-
200
- /**
201
- * Check if license can be activated on a given number of production and localhost sites.
202
- *
203
- * @author Vova Feldman (@svovaf)
204
- * @since 2.0.0
205
- *
206
- * @param int $production_count
207
- * @param int $localhost_count
208
- *
209
- * @return bool
210
- */
211
- function can_activate_bulk( $production_count, $localhost_count ) {
212
- if ( $this->is_unlimited() ) {
213
- return true;
214
- }
215
-
216
- /**
217
- * For simplicity, the logic will work as following: when given X sites to activate the license on, if it's
218
- * possible to activate on ALL of them, do the activation. If it's not possible to activate on ALL of them,
219
- * do NOT activate on any of them.
220
- */
221
- return ( $this->quota >= $this->activated + $production_count + ( $this->is_free_localhost ? 0 : $this->activated_local + $localhost_count ) );
222
- }
223
-
224
- /**
225
- * @author Vova Feldman (@svovaf)
226
- * @since 1.2.1
227
- *
228
- * @return bool
229
- */
230
- function is_active() {
231
- return ( ! $this->is_cancelled );
232
- }
233
-
234
- /**
235
- * Check if license's plan features are enabled.
236
- *
237
- * - Either if plan not expired
238
- * - If expired, based on the configuration to block features or not.
239
- *
240
- * @author Vova Feldman (@svovaf)
241
- * @since 1.0.6
242
- *
243
- * @return bool
244
- */
245
- function is_features_enabled() {
246
- return $this->is_active() && ( ! $this->is_block_features || ! $this->is_expired() );
247
- }
248
-
249
- /**
250
- * Subscription considered to be new without any payments
251
- * if the license expires in less than 24 hours
252
- * from the license creation.
253
- *
254
- * @author Vova Feldman (@svovaf)
255
- * @since 1.0.9
256
- *
257
- * @return bool
258
- */
259
- function is_first_payment_pending() {
260
- return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->expiration ) - strtotime( $this->created ) );
261
- }
262
-
263
- /**
264
- * @return int
265
- */
266
- function total_activations() {
267
- return ( $this->activated + $this->activated_local );
268
- }
269
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.5
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Plugin_License
15
+ */
16
+ class FS_Plugin_License extends FS_Entity {
17
+
18
+ #region Properties
19
+
20
+ /**
21
+ * @var number
22
+ */
23
+ public $plugin_id;
24
+ /**
25
+ * @var number
26
+ */
27
+ public $user_id;
28
+ /**
29
+ * @var number
30
+ */
31
+ public $plan_id;
32
+ /**
33
+ * @var number
34
+ */
35
+ public $pricing_id;
36
+ /**
37
+ * @var int|null
38
+ */
39
+ public $quota;
40
+ /**
41
+ * @var int
42
+ */
43
+ public $activated;
44
+ /**
45
+ * @var int
46
+ */
47
+ public $activated_local;
48
+ /**
49
+ * @var string
50
+ */
51
+ public $expiration;
52
+ /**
53
+ * @var string
54
+ */
55
+ public $secret_key;
56
+ /**
57
+ * @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
58
+ * license.
59
+ */
60
+ public $is_free_localhost;
61
+ /**
62
+ * @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
63
+ * block updates and support.
64
+ */
65
+ public $is_block_features;
66
+ /**
67
+ * @var bool
68
+ */
69
+ public $is_cancelled;
70
+
71
+ #endregion Properties
72
+
73
+ /**
74
+ * @param stdClass|bool $license
75
+ */
76
+ function __construct( $license = false ) {
77
+ parent::__construct( $license );
78
+ }
79
+
80
+ /**
81
+ * Get entity type.
82
+ *
83
+ * @return string
84
+ */
85
+ static function get_type() {
86
+ return 'license';
87
+ }
88
+
89
+ /**
90
+ * Check how many site activations left.
91
+ *
92
+ * @author Vova Feldman (@svovaf)
93
+ * @since 1.0.5
94
+ *
95
+ * @return int
96
+ */
97
+ function left() {
98
+ if ( ! $this->is_active() || $this->is_expired() ) {
99
+ return 0;
100
+ }
101
+
102
+ if ( $this->is_unlimited() ) {
103
+ return 999;
104
+ }
105
+
106
+ return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
107
+ }
108
+
109
+ /**
110
+ * Check if single site license.
111
+ *
112
+ * @author Vova Feldman (@svovaf)
113
+ * @since 1.1.8.1
114
+ *
115
+ * @return bool
116
+ */
117
+ function is_single_site() {
118
+ return ( is_numeric( $this->quota ) && 1 == $this->quota );
119
+ }
120
+
121
+ /**
122
+ * @author Vova Feldman (@svovaf)
123
+ * @since 1.0.5
124
+ *
125
+ * @return bool
126
+ */
127
+ function is_expired() {
128
+ return ! $this->is_lifetime() && ( strtotime( $this->expiration ) < WP_FS__SCRIPT_START_TIME );
129
+ }
130
+
131
+ /**
132
+ * Check if license is not expired.
133
+ *
134
+ * @author Vova Feldman (@svovaf)
135
+ * @since 1.2.1
136
+ *
137
+ * @return bool
138
+ */
139
+ function is_valid() {
140
+ return ! $this->is_expired();
141
+ }
142
+
143
+ /**
144
+ * @author Vova Feldman (@svovaf)
145
+ * @since 1.0.6
146
+ *
147
+ * @return bool
148
+ */
149
+ function is_lifetime() {
150
+ return is_null( $this->expiration );
151
+ }
152
+
153
+ /**
154
+ * @author Vova Feldman (@svovaf)
155
+ * @since 1.2.0
156
+ *
157
+ * @return bool
158
+ */
159
+ function is_unlimited() {
160
+ return is_null( $this->quota );
161
+ }
162
+
163
+ /**
164
+ * Check if license is fully utilized.
165
+ *
166
+ * @author Vova Feldman (@svovaf)
167
+ * @since 1.0.6
168
+ *
169
+ * @param bool|null $is_localhost
170
+ *
171
+ * @return bool
172
+ */
173
+ function is_utilized( $is_localhost = null ) {
174
+ if ( is_null( $is_localhost ) ) {
175
+ $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
176
+ }
177
+
178
+ if ( $this->is_unlimited() ) {
179
+ return false;
180
+ }
181
+
182
+ return ! ( $this->is_free_localhost && $is_localhost ) &&
183
+ ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
184
+ }
185
+
186
+ /**
187
+ * Check if license can be activated.
188
+ *
189
+ * @author Vova Feldman (@svovaf)
190
+ * @since 2.0.0
191
+ *
192
+ * @param bool|null $is_localhost
193
+ *
194
+ * @return bool
195
+ */
196
+ function can_activate( $is_localhost = null ) {
197
+ return ! $this->is_utilized( $is_localhost ) && $this->is_features_enabled();
198
+ }
199
+
200
+ /**
201
+ * Check if license can be activated on a given number of production and localhost sites.
202
+ *
203
+ * @author Vova Feldman (@svovaf)
204
+ * @since 2.0.0
205
+ *
206
+ * @param int $production_count
207
+ * @param int $localhost_count
208
+ *
209
+ * @return bool
210
+ */
211
+ function can_activate_bulk( $production_count, $localhost_count ) {
212
+ if ( $this->is_unlimited() ) {
213
+ return true;
214
+ }
215
+
216
+ /**
217
+ * For simplicity, the logic will work as following: when given X sites to activate the license on, if it's
218
+ * possible to activate on ALL of them, do the activation. If it's not possible to activate on ALL of them,
219
+ * do NOT activate on any of them.
220
+ */
221
+ return ( $this->quota >= $this->activated + $production_count + ( $this->is_free_localhost ? 0 : $this->activated_local + $localhost_count ) );
222
+ }
223
+
224
+ /**
225
+ * @author Vova Feldman (@svovaf)
226
+ * @since 1.2.1
227
+ *
228
+ * @return bool
229
+ */
230
+ function is_active() {
231
+ return ( ! $this->is_cancelled );
232
+ }
233
+
234
+ /**
235
+ * Check if license's plan features are enabled.
236
+ *
237
+ * - Either if plan not expired
238
+ * - If expired, based on the configuration to block features or not.
239
+ *
240
+ * @author Vova Feldman (@svovaf)
241
+ * @since 1.0.6
242
+ *
243
+ * @return bool
244
+ */
245
+ function is_features_enabled() {
246
+ return $this->is_active() && ( ! $this->is_block_features || ! $this->is_expired() );
247
+ }
248
+
249
+ /**
250
+ * Subscription considered to be new without any payments
251
+ * if the license expires in less than 24 hours
252
+ * from the license creation.
253
+ *
254
+ * @author Vova Feldman (@svovaf)
255
+ * @since 1.0.9
256
+ *
257
+ * @return bool
258
+ */
259
+ function is_first_payment_pending() {
260
+ return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->expiration ) - strtotime( $this->created ) );
261
+ }
262
+
263
+ /**
264
+ * @return int
265
+ */
266
+ function total_activations() {
267
+ return ( $this->activated + $this->activated_local );
268
+ }
269
+ }
includes/pum-sdk/freemius/includes/entities/class-fs-plugin-plan.php CHANGED
@@ -1,145 +1,145 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.5
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Plugin_Plan
15
- *
16
- * @property FS_Pricing[] $pricing
17
- */
18
- class FS_Plugin_Plan extends FS_Entity {
19
-
20
- #region Properties
21
-
22
- /**
23
- * @var number
24
- */
25
- public $plugin_id;
26
- /**
27
- * @var string
28
- */
29
- public $name;
30
- /**
31
- * @var string
32
- */
33
- public $title;
34
- /**
35
- * @var string
36
- */
37
- public $description;
38
- /**
39
- * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license.
40
- */
41
- public $is_free_localhost;
42
- /**
43
- * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and
44
- * support.
45
- */
46
- public $is_block_features;
47
- /**
48
- * @var int
49
- */
50
- public $license_type;
51
- /**
52
- * @var bool
53
- */
54
- public $is_https_support;
55
- /**
56
- * @var int Trial days.
57
- */
58
- public $trial_period;
59
- /**
60
- * @var string If true, require payment for trial.
61
- */
62
- public $is_require_subscription;
63
- /**
64
- * @var string Knowledge Base URL.
65
- */
66
- public $support_kb;
67
- /**
68
- * @var string Support Forum URL.
69
- */
70
- public $support_forum;
71
- /**
72
- * @var string Support email address.
73
- */
74
- public $support_email;
75
- /**
76
- * @var string Support phone.
77
- */
78
- public $support_phone;
79
- /**
80
- * @var string Support skype username.
81
- */
82
- public $support_skype;
83
- /**
84
- * @var bool Is personal success manager supported with the plan.
85
- */
86
- public $is_success_manager;
87
- /**
88
- * @var bool Is featured plan.
89
- */
90
- public $is_featured;
91
-
92
- #endregion Properties
93
-
94
- /**
95
- * @param object|bool $plan
96
- */
97
- function __construct( $plan = false ) {
98
- parent::__construct( $plan );
99
-
100
- if ( is_object( $plan ) ) {
101
- $this->name = strtolower( $plan->name );
102
- }
103
- }
104
-
105
- static function get_type() {
106
- return 'plan';
107
- }
108
-
109
- /**
110
- * @author Vova Feldman (@svovaf)
111
- * @since 1.0.9
112
- *
113
- * @return bool
114
- */
115
- function is_free() {
116
- return ( 'free' === $this->name );
117
- }
118
-
119
- /**
120
- * Checks if this plan supports "Technical Support".
121
- *
122
- * @author Leo Fajardo (leorw)
123
- * @since 1.2.0
124
- *
125
- * @return bool
126
- */
127
- function has_technical_support() {
128
- return ( ! empty( $this->support_email ) ||
129
- ! empty( $this->support_skype ) ||
130
- ! empty( $this->support_phone ) ||
131
- ! empty( $this->is_success_manager )
132
- );
133
- }
134
-
135
- /**
136
- * @author Vova Feldman (@svovaf)
137
- * @since 1.0.9
138
- *
139
- * @return bool
140
- */
141
- function has_trial() {
142
- return ! $this->is_free() &&
143
- is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );
144
- }
145
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.5
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Plugin_Plan
15
+ *
16
+ * @property FS_Pricing[] $pricing
17
+ */
18
+ class FS_Plugin_Plan extends FS_Entity {
19
+
20
+ #region Properties
21
+
22
+ /**
23
+ * @var number
24
+ */
25
+ public $plugin_id;
26
+ /**
27
+ * @var string
28
+ */
29
+ public $name;
30
+ /**
31
+ * @var string
32
+ */
33
+ public $title;
34
+ /**
35
+ * @var string
36
+ */
37
+ public $description;
38
+ /**
39
+ * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license.
40
+ */
41
+ public $is_free_localhost;
42
+ /**
43
+ * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and
44
+ * support.
45
+ */
46
+ public $is_block_features;
47
+ /**
48
+ * @var int
49
+ */
50
+ public $license_type;
51
+ /**
52
+ * @var bool
53
+ */
54
+ public $is_https_support;
55
+ /**
56
+ * @var int Trial days.
57
+ */
58
+ public $trial_period;
59
+ /**
60
+ * @var string If true, require payment for trial.
61
+ */
62
+ public $is_require_subscription;
63
+ /**
64
+ * @var string Knowledge Base URL.
65
+ */
66
+ public $support_kb;
67
+ /**
68
+ * @var string Support Forum URL.
69
+ */
70
+ public $support_forum;
71
+ /**
72
+ * @var string Support email address.
73
+ */
74
+ public $support_email;
75
+ /**
76
+ * @var string Support phone.
77
+ */
78
+ public $support_phone;
79
+ /**
80
+ * @var string Support skype username.
81
+ */
82
+ public $support_skype;
83
+ /**
84
+ * @var bool Is personal success manager supported with the plan.
85
+ */
86
+ public $is_success_manager;
87
+ /**
88
+ * @var bool Is featured plan.
89
+ */
90
+ public $is_featured;
91
+
92
+ #endregion Properties
93
+
94
+ /**
95
+ * @param object|bool $plan
96
+ */
97
+ function __construct( $plan = false ) {
98
+ parent::__construct( $plan );
99
+
100
+ if ( is_object( $plan ) ) {
101
+ $this->name = strtolower( $plan->name );
102
+ }
103
+ }
104
+
105
+ static function get_type() {
106
+ return 'plan';
107
+ }
108
+
109
+ /**
110
+ * @author Vova Feldman (@svovaf)
111
+ * @since 1.0.9
112
+ *
113
+ * @return bool
114
+ */
115
+ function is_free() {
116
+ return ( 'free' === $this->name );
117
+ }
118
+
119
+ /**
120
+ * Checks if this plan supports "Technical Support".
121
+ *
122
+ * @author Leo Fajardo (leorw)
123
+ * @since 1.2.0
124
+ *
125
+ * @return bool
126
+ */
127
+ function has_technical_support() {
128
+ return ( ! empty( $this->support_email ) ||
129
+ ! empty( $this->support_skype ) ||
130
+ ! empty( $this->support_phone ) ||
131
+ ! empty( $this->is_success_manager )
132
+ );
133
+ }
134
+
135
+ /**
136
+ * @author Vova Feldman (@svovaf)
137
+ * @since 1.0.9
138
+ *
139
+ * @return bool
140
+ */
141
+ function has_trial() {
142
+ return ! $this->is_free() &&
143
+ is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );
144
+ }
145
  }
includes/pum-sdk/freemius/includes/entities/class-fs-plugin-tag.php CHANGED
@@ -1,50 +1,50 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2018, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 2.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Plugin_Tag extends FS_Entity {
14
- /**
15
- * @var string
16
- */
17
- public $version;
18
- /**
19
- * @var string
20
- */
21
- public $url;
22
- /**
23
- * @var string
24
- */
25
- public $requires_platform_version;
26
- /**
27
- * @var string
28
- */
29
- public $tested_up_to_version;
30
- /**
31
- * @var bool
32
- */
33
- public $has_free;
34
- /**
35
- * @var bool
36
- */
37
- public $has_premium;
38
- /**
39
- * @var bool
40
- */
41
- public $is_released;
42
-
43
- function __construct( $tag = false ) {
44
- parent::__construct( $tag );
45
- }
46
-
47
- static function get_type() {
48
- return 'tag';
49
- }
50
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2018, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 2.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin_Tag extends FS_Entity {
14
+ /**
15
+ * @var string
16
+ */
17
+ public $version;
18
+ /**
19
+ * @var string
20
+ */
21
+ public $url;
22
+ /**
23
+ * @var string
24
+ */
25
+ public $requires_platform_version;
26
+ /**
27
+ * @var string
28
+ */
29
+ public $tested_up_to_version;
30
+ /**
31
+ * @var bool
32
+ */
33
+ public $has_free;
34
+ /**
35
+ * @var bool
36
+ */
37
+ public $has_premium;
38
+ /**
39
+ * @var bool
40
+ */
41
+ public $is_released;
42
+
43
+ function __construct( $tag = false ) {
44
+ parent::__construct( $tag );
45
+ }
46
+
47
+ static function get_type() {
48
+ return 'tag';
49
+ }
50
  }
includes/pum-sdk/freemius/includes/entities/class-fs-plugin.php CHANGED
@@ -1,120 +1,142 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Plugin extends FS_Scope_Entity {
14
- /**
15
- * @since 1.0.6
16
- * @var null|number
17
- */
18
- public $parent_plugin_id;
19
- /**
20
- * @var string
21
- */
22
- public $title;
23
- /**
24
- * @var string
25
- */
26
- public $slug;
27
- /**
28
- * @since 1.2.2
29
- *
30
- * @var string 'plugin' or 'theme'
31
- */
32
- public $type;
33
- /**
34
- * @author Leo Fajardo (@leorw)
35
- *
36
- * @since 1.2.3
37
- *
38
- * @var string|false false if the module doesn't have an affiliate program or one of the following: 'selected', 'customers', or 'all'.
39
- */
40
- public $affiliate_moderation;
41
- /**
42
- * @var bool Set to true if the free version of the module is hosted on WordPress.org. Defaults to true.
43
- */
44
- public $is_wp_org_compliant = true;
45
-
46
- #region Install Specific Properties
47
-
48
- /**
49
- * @var string
50
- */
51
- public $file;
52
- /**
53
- * @var string
54
- */
55
- public $version;
56
- /**
57
- * @var bool
58
- */
59
- public $auto_update;
60
- /**
61
- * @var FS_Plugin_Info
62
- */
63
- public $info;
64
- /**
65
- * @since 1.0.9
66
- *
67
- * @var bool
68
- */
69
- public $is_premium;
70
- /**
71
- * @since 1.0.9
72
- *
73
- * @var bool
74
- */
75
- public $is_live;
76
-
77
- const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
78
-
79
- #endregion Install Specific Properties
80
-
81
- /**
82
- * @param stdClass|bool $plugin
83
- */
84
- function __construct( $plugin = false ) {
85
- parent::__construct( $plugin );
86
-
87
- $this->is_premium = false;
88
- $this->is_live = true;
89
-
90
- if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
91
- $this->info = new FS_Plugin_Info( $plugin->info );
92
- }
93
- }
94
-
95
- /**
96
- * Check if plugin is an add-on (has parent).
97
- *
98
- * @author Vova Feldman (@svovaf)
99
- * @since 1.0.6
100
- *
101
- * @return bool
102
- */
103
- function is_addon() {
104
- return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
105
- }
106
-
107
- /**
108
- * @author Leo Fajardo (@leorw)
109
- * @since 1.2.3
110
- *
111
- * @return bool
112
- */
113
- function has_affiliate_program() {
114
- return ( ! empty( $this->affiliate_moderation ) );
115
- }
116
-
117
- static function get_type() {
118
- return 'plugin';
119
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin extends FS_Scope_Entity {
14
+ /**
15
+ * @since 1.0.6
16
+ * @var null|number
17
+ */
18
+ public $parent_plugin_id;
19
+ /**
20
+ * @var string
21
+ */
22
+ public $title;
23
+ /**
24
+ * @var string
25
+ */
26
+ public $slug;
27
+ /**
28
+ * @author Leo Fajardo (@leorw)
29
+ * @since 2.2.1
30
+ *
31
+ * @var string
32
+ */
33
+ public $premium_slug;
34
+ /**
35
+ * @since 1.2.2
36
+ *
37
+ * @var string 'plugin' or 'theme'
38
+ */
39
+ public $type;
40
+ /**
41
+ * @author Leo Fajardo (@leorw)
42
+ *
43
+ * @since 1.2.3
44
+ *
45
+ * @var string|false false if the module doesn't have an affiliate program or one of the following: 'selected', 'customers', or 'all'.
46
+ */
47
+ public $affiliate_moderation;
48
+ /**
49
+ * @var bool Set to true if the free version of the module is hosted on WordPress.org. Defaults to true.
50
+ */
51
+ public $is_wp_org_compliant = true;
52
+
53
+ #region Install Specific Properties
54
+
55
+ /**
56
+ * @var string
57
+ */
58
+ public $file;
59
+ /**
60
+ * @var string
61
+ */
62
+ public $version;
63
+ /**
64
+ * @var bool
65
+ */
66
+ public $auto_update;
67
+ /**
68
+ * @var FS_Plugin_Info
69
+ */
70
+ public $info;
71
+ /**
72
+ * @since 1.0.9
73
+ *
74
+ * @var bool
75
+ */
76
+ public $is_premium;
77
+ /**
78
+ * @author Leo Fajardo (@leorw)
79
+ * @since 2.2.1
80
+ *
81
+ * @var string
82
+ */
83
+ public $premium_suffix;
84
+ /**
85
+ * @since 1.0.9
86
+ *
87
+ * @var bool
88
+ */
89
+ public $is_live;
90
+
91
+ const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
92
+
93
+ #endregion Install Specific Properties
94
+
95
+ /**
96
+ * @param stdClass|bool $plugin
97
+ */
98
+ function __construct( $plugin = false ) {
99
+ parent::__construct( $plugin );
100
+
101
+ $this->is_premium = false;
102
+ $this->is_live = true;
103
+
104
+ if ( empty( $this->premium_slug ) && ! empty( $plugin->slug ) ) {
105
+ $this->premium_slug = "{$this->slug}-premium";
106
+ }
107
+
108
+ if ( empty( $this->premium_suffix ) ) {
109
+ $this->premium_suffix = '(Premium)';
110
+ }
111
+
112
+ if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
113
+ $this->info = new FS_Plugin_Info( $plugin->info );
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Check if plugin is an add-on (has parent).
119
+ *
120
+ * @author Vova Feldman (@svovaf)
121
+ * @since 1.0.6
122
+ *
123
+ * @return bool
124
+ */
125
+ function is_addon() {
126
+ return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
127
+ }
128
+
129
+ /**
130
+ * @author Leo Fajardo (@leorw)
131
+ * @since 1.2.3
132
+ *
133
+ * @return bool
134
+ */
135
+ function has_affiliate_program() {
136
+ return ( ! empty( $this->affiliate_moderation ) );
137
+ }
138
+
139
+ static function get_type() {
140
+ return 'plugin';
141
+ }
142
  }
includes/pum-sdk/freemius/includes/entities/class-fs-pricing.php CHANGED
@@ -1,141 +1,141 @@
1
- <?php
2
- /**
3
- * @package Freemius for EDD Add-On
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Pricing extends FS_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var number
19
- */
20
- public $plan_id;
21
- /**
22
- * @var int
23
- */
24
- public $licenses;
25
- /**
26
- * @var null|float
27
- */
28
- public $monthly_price;
29
- /**
30
- * @var null|float
31
- */
32
- public $annual_price;
33
- /**
34
- * @var null|float
35
- */
36
- public $lifetime_price;
37
-
38
- #endregion Properties
39
-
40
- /**
41
- * @param object|bool $pricing
42
- */
43
- function __construct( $pricing = false ) {
44
- parent::__construct( $pricing );
45
- }
46
-
47
- static function get_type() {
48
- return 'pricing';
49
- }
50
-
51
- /**
52
- * @author Vova Feldman (@svovaf)
53
- * @since 1.1.8
54
- *
55
- * @return bool
56
- */
57
- function has_monthly() {
58
- return ( is_numeric( $this->monthly_price ) && $this->monthly_price > 0 );
59
- }
60
-
61
- /**
62
- * @author Vova Feldman (@svovaf)
63
- * @since 1.1.8
64
- *
65
- * @return bool
66
- */
67
- function has_annual() {
68
- return ( is_numeric( $this->annual_price ) && $this->annual_price > 0 );
69
- }
70
-
71
- /**
72
- * @author Vova Feldman (@svovaf)
73
- * @since 1.1.8
74
- *
75
- * @return bool
76
- */
77
- function has_lifetime() {
78
- return ( is_numeric( $this->lifetime_price ) && $this->lifetime_price > 0 );
79
- }
80
-
81
- /**
82
- * Check if unlimited licenses pricing.
83
- *
84
- * @author Vova Feldman (@svovaf)
85
- * @since 1.1.8
86
- *
87
- * @return bool
88
- */
89
- function is_unlimited() {
90
- return is_null( $this->licenses );
91
- }
92
-
93
-
94
- /**
95
- * Check if pricing has more than one billing cycle.
96
- *
97
- * @author Vova Feldman (@svovaf)
98
- * @since 1.1.8
99
- *
100
- * @return bool
101
- */
102
- function is_multi_cycle() {
103
- $cycles = 0;
104
- if ( $this->has_monthly() ) {
105
- $cycles ++;
106
- }
107
- if ( $this->has_annual() ) {
108
- $cycles ++;
109
- }
110
- if ( $this->has_lifetime() ) {
111
- $cycles ++;
112
- }
113
-
114
- return $cycles > 1;
115
- }
116
-
117
- /**
118
- * Get annual over monthly discount.
119
- *
120
- * @author Vova Feldman (@svovaf)
121
- * @since 1.1.8
122
- *
123
- * @return int
124
- */
125
- function annual_discount_percentage() {
126
- return floor( $this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100 );
127
- }
128
-
129
- /**
130
- * Get annual over monthly savings.
131
- *
132
- * @author Vova Feldman (@svovaf)
133
- * @since 1.1.8
134
- *
135
- * @return float
136
- */
137
- function annual_savings() {
138
- return ( $this->monthly_price * 12 - $this->annual_price ) * ( $this->is_unlimited() ? 1 : $this->licenses );
139
- }
140
-
141
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius for EDD Add-On
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Pricing extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $plan_id;
21
+ /**
22
+ * @var int
23
+ */
24
+ public $licenses;
25
+ /**
26
+ * @var null|float
27
+ */
28
+ public $monthly_price;
29
+ /**
30
+ * @var null|float
31
+ */
32
+ public $annual_price;
33
+ /**
34
+ * @var null|float
35
+ */
36
+ public $lifetime_price;
37
+
38
+ #endregion Properties
39
+
40
+ /**
41
+ * @param object|bool $pricing
42
+ */
43
+ function __construct( $pricing = false ) {
44
+ parent::__construct( $pricing );
45
+ }
46
+
47
+ static function get_type() {
48
+ return 'pricing';
49
+ }
50
+
51
+ /**
52
+ * @author Vova Feldman (@svovaf)
53
+ * @since 1.1.8
54
+ *
55
+ * @return bool
56
+ */
57
+ function has_monthly() {
58
+ return ( is_numeric( $this->monthly_price ) && $this->monthly_price > 0 );
59
+ }
60
+
61
+ /**
62
+ * @author Vova Feldman (@svovaf)
63
+ * @since 1.1.8
64
+ *
65
+ * @return bool
66
+ */
67
+ function has_annual() {
68
+ return ( is_numeric( $this->annual_price ) && $this->annual_price > 0 );
69
+ }
70
+
71
+ /**
72
+ * @author Vova Feldman (@svovaf)
73
+ * @since 1.1.8
74
+ *
75
+ * @return bool
76
+ */
77
+ function has_lifetime() {
78
+ return ( is_numeric( $this->lifetime_price ) && $this->lifetime_price > 0 );
79
+ }
80
+
81
+ /**
82
+ * Check if unlimited licenses pricing.
83
+ *
84
+ * @author Vova Feldman (@svovaf)
85
+ * @since 1.1.8
86
+ *
87
+ * @return bool
88
+ */
89
+ function is_unlimited() {
90
+ return is_null( $this->licenses );
91
+ }
92
+
93
+
94
+ /**
95
+ * Check if pricing has more than one billing cycle.
96
+ *
97
+ * @author Vova Feldman (@svovaf)
98
+ * @since 1.1.8
99
+ *
100
+ * @return bool
101
+ */
102
+ function is_multi_cycle() {
103
+ $cycles = 0;
104
+ if ( $this->has_monthly() ) {
105
+ $cycles ++;
106
+ }
107
+ if ( $this->has_annual() ) {
108
+ $cycles ++;
109
+ }
110
+ if ( $this->has_lifetime() ) {
111
+ $cycles ++;
112
+ }
113
+
114
+ return $cycles > 1;
115
+ }
116
+
117
+ /**
118
+ * Get annual over monthly discount.
119
+ *
120
+ * @author Vova Feldman (@svovaf)
121
+ * @since 1.1.8
122
+ *
123
+ * @return int
124
+ */
125
+ function annual_discount_percentage() {
126
+ return floor( $this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100 );
127
+ }
128
+
129
+ /**
130
+ * Get annual over monthly savings.
131
+ *
132
+ * @author Vova Feldman (@svovaf)
133
+ * @since 1.1.8
134
+ *
135
+ * @return float
136
+ */
137
+ function annual_savings() {
138
+ return ( $this->monthly_price * 12 - $this->annual_price ) * ( $this->is_unlimited() ? 1 : $this->licenses );
139
+ }
140
+
141
  }
includes/pum-sdk/freemius/includes/entities/class-fs-scope-entity.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.4
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Scope_Entity extends FS_Entity {
14
- /**
15
- * @var string
16
- */
17
- public $public_key;
18
- /**
19
- * @var string
20
- */
21
- public $secret_key;
22
-
23
- /**
24
- * @param bool|stdClass $scope_entity
25
- */
26
- function __construct( $scope_entity = false ) {
27
- parent::__construct( $scope_entity );
28
- }
29
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.4
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Scope_Entity extends FS_Entity {
14
+ /**
15
+ * @var string
16
+ */
17
+ public $public_key;
18
+ /**
19
+ * @var string
20
+ */
21
+ public $secret_key;
22
+
23
+ /**
24
+ * @param bool|stdClass $scope_entity
25
+ */
26
+ function __construct( $scope_entity = false ) {
27
+ parent::__construct( $scope_entity );
28
+ }
29
  }
includes/pum-sdk/freemius/includes/entities/class-fs-site.php CHANGED
@@ -1,225 +1,230 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Site extends FS_Scope_Entity {
14
- /**
15
- * @var number
16
- */
17
- public $site_id;
18
- /**
19
- * @var number
20
- */
21
- public $plugin_id;
22
- /**
23
- * @var number
24
- */
25
- public $user_id;
26
- /**
27
- * @var string
28
- */
29
- public $title;
30
- /**
31
- * @var string
32
- */
33
- public $url;
34
- /**
35
- * @var string
36
- */
37
- public $version;
38
- /**
39
- * @var string E.g. en-GB
40
- */
41
- public $language;
42
- /**
43
- * @var string E.g. UTF-8
44
- */
45
- public $charset;
46
- /**
47
- * @var string Platform version (e.g WordPress version).
48
- */
49
- public $platform_version;
50
- /**
51
- * Freemius SDK version
52
- *
53
- * @author Leo Fajardo (@leorw)
54
- * @since 1.2.2
55
- *
56
- * @var string SDK version (e.g.: 1.2.2)
57
- */
58
- public $sdk_version;
59
- /**
60
- * @var string Programming language version (e.g PHP version).
61
- */
62
- public $programming_language_version;
63
- /**
64
- * @var number|null
65
- */
66
- public $plan_id;
67
- /**
68
- * @var number|null
69
- */
70
- public $license_id;
71
- /**
72
- * @var number|null
73
- */
74
- public $trial_plan_id;
75
- /**
76
- * @var string|null
77
- */
78
- public $trial_ends;
79
- /**
80
- * @since 1.0.9
81
- *
82
- * @var bool
83
- */
84
- public $is_premium = false;
85
- /**
86
- * @author Leo Fajardo (@leorw)
87
- *
88
- * @since 1.2.1.5
89
- *
90
- * @var bool
91
- */
92
- public $is_disconnected = false;
93
- /**
94
- * @since 2.0.0
95
- *
96
- * @var bool
97
- */
98
- public $is_active = true;
99
- /**
100
- * @since 2.0.0
101
- *
102
- * @var bool
103
- */
104
- public $is_uninstalled = false;
105
-
106
- /**
107
- * @param stdClass|bool $site
108
- */
109
- function __construct( $site = false ) {
110
- parent::__construct( $site );
111
-
112
- if ( is_object( $site ) ) {
113
- $this->plan_id = $site->plan_id;
114
- }
115
-
116
- if ( ! is_bool( $this->is_disconnected ) ) {
117
- $this->is_disconnected = false;
118
- }
119
- }
120
-
121
- static function get_type() {
122
- return 'install';
123
- }
124
-
125
- /**
126
- * @author Vova Feldman (@svovaf)
127
- * @since 2.0.0
128
- *
129
- * @param string $url
130
- *
131
- * @return bool
132
- */
133
- static function is_localhost_by_address( $url ) {
134
- if ( false !== strpos( $url, '127.0.0.1' ) ||
135
- false !== strpos( $url, 'localhost' )
136
- ) {
137
- return true;
138
- }
139
-
140
- if ( ! fs_starts_with( $url, 'http' ) ) {
141
- $url = 'http://' . $url;
142
- }
143
-
144
- $url_parts = parse_url( $url );
145
-
146
- $subdomain = $url_parts['host'];
147
-
148
- return (
149
- // Starts with.
150
- fs_starts_with( $subdomain, 'local.' ) ||
151
- fs_starts_with( $subdomain, 'dev.' ) ||
152
- fs_starts_with( $subdomain, 'test.' ) ||
153
- fs_starts_with( $subdomain, 'staging.' ) ||
154
-
155
- // Ends with.
156
- fs_ends_with( $subdomain, '.dev' ) ||
157
- fs_ends_with( $subdomain, '.test' ) ||
158
- fs_ends_with( $subdomain, '.staging' ) ||
159
- fs_ends_with( $subdomain, '.local' ) ||
160
- fs_ends_with( $subdomain, '.example' ) ||
161
- fs_ends_with( $subdomain, '.invalid' ) ||
162
- // GoDaddy test/dev.
163
- fs_ends_with( $subdomain, '.myftpupload.com' ) ||
164
- // ngrok tunneling.
165
- fs_ends_with( $subdomain, '.ngrok.io' ) ||
166
- // SiteGround staging.
167
- fs_starts_with( $subdomain, 'staging' ) ||
168
- // WPEngine staging.
169
- fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
170
- // Pantheon
171
- ( fs_ends_with($subdomain, 'pantheonsite.io') &&
172
- (fs_starts_with($subdomain, 'test-') || fs_starts_with($subdomain, 'dev-'))) ||
173
- // Cloudways
174
- fs_ends_with( $subdomain, '.cloudwaysapps.com' )
175
- );
176
- }
177
-
178
- function is_localhost() {
179
- return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
180
- }
181
-
182
- /**
183
- * Check if site in trial.
184
- *
185
- * @author Vova Feldman (@svovaf)
186
- * @since 1.0.9
187
- *
188
- * @return bool
189
- */
190
- function is_trial() {
191
- return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
192
- }
193
-
194
- /**
195
- * Check if user already utilized the trial with the current install.
196
- *
197
- * @author Vova Feldman (@svovaf)
198
- * @since 1.0.9
199
- *
200
- * @return bool
201
- */
202
- function is_trial_utilized() {
203
- return is_numeric( $this->trial_plan_id );
204
- }
205
-
206
- /**
207
- * @author Vova Feldman (@svovaf)
208
- * @since 2.0.0
209
- *
210
- * @return bool
211
- */
212
- function is_tracking_allowed() {
213
- return ( true !== $this->is_disconnected );
214
- }
215
-
216
- /**
217
- * @author Vova Feldman (@svovaf)
218
- * @since 2.0.0
219
- *
220
- * @return bool
221
- */
222
- function is_tracking_prohibited() {
223
- return ! $this->is_tracking_allowed();
224
- }
 
 
 
 
 
225
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Site extends FS_Scope_Entity {
14
+ /**
15
+ * @var number
16
+ */
17
+ public $site_id;
18
+ /**
19
+ * @var number
20
+ */
21
+ public $plugin_id;
22
+ /**
23
+ * @var number
24
+ */
25
+ public $user_id;
26
+ /**
27
+ * @var string
28
+ */
29
+ public $title;
30
+ /**
31
+ * @var string
32
+ */
33
+ public $url;
34
+ /**
35
+ * @var string
36
+ */
37
+ public $version;
38
+ /**
39
+ * @var string E.g. en-GB
40
+ */
41
+ public $language;
42
+ /**
43
+ * @var string E.g. UTF-8
44
+ */
45
+ public $charset;
46
+ /**
47
+ * @var string Platform version (e.g WordPress version).
48
+ */
49
+ public $platform_version;
50
+ /**
51
+ * Freemius SDK version
52
+ *
53
+ * @author Leo Fajardo (@leorw)
54
+ * @since 1.2.2
55
+ *
56
+ * @var string SDK version (e.g.: 1.2.2)
57
+ */
58
+ public $sdk_version;
59
+ /**
60
+ * @var string Programming language version (e.g PHP version).
61
+ */
62
+ public $programming_language_version;
63
+ /**
64
+ * @var number|null
65
+ */
66
+ public $plan_id;
67
+ /**
68
+ * @var number|null
69
+ */
70
+ public $license_id;
71
+ /**
72
+ * @var number|null
73
+ */
74
+ public $trial_plan_id;
75
+ /**
76
+ * @var string|null
77
+ */
78
+ public $trial_ends;
79
+ /**
80
+ * @since 1.0.9
81
+ *
82
+ * @var bool
83
+ */
84
+ public $is_premium = false;
85
+ /**
86
+ * @author Leo Fajardo (@leorw)
87
+ *
88
+ * @since 1.2.1.5
89
+ *
90
+ * @var bool
91
+ */
92
+ public $is_disconnected = false;
93
+ /**
94
+ * @since 2.0.0
95
+ *
96
+ * @var bool
97
+ */
98
+ public $is_active = true;
99
+ /**
100
+ * @since 2.0.0
101
+ *
102
+ * @var bool
103
+ */
104
+ public $is_uninstalled = false;
105
+
106
+ /**
107
+ * @param stdClass|bool $site
108
+ */
109
+ function __construct( $site = false ) {
110
+ parent::__construct( $site );
111
+
112
+ if ( is_object( $site ) ) {
113
+ $this->plan_id = $site->plan_id;
114
+ }
115
+
116
+ if ( ! is_bool( $this->is_disconnected ) ) {
117
+ $this->is_disconnected = false;
118
+ }
119
+ }
120
+
121
+ static function get_type() {
122
+ return 'install';
123
+ }
124
+
125
+ /**
126
+ * @author Vova Feldman (@svovaf)
127
+ * @since 2.0.0
128
+ *
129
+ * @param string $url
130
+ *
131
+ * @return bool
132
+ */
133
+ static function is_localhost_by_address( $url ) {
134
+ if ( false !== strpos( $url, '127.0.0.1' ) ||
135
+ false !== strpos( $url, 'localhost' )
136
+ ) {
137
+ return true;
138
+ }
139
+
140
+ if ( ! fs_starts_with( $url, 'http' ) ) {
141
+ $url = 'http://' . $url;
142
+ }
143
+
144
+ $url_parts = parse_url( $url );
145
+
146
+ $subdomain = $url_parts['host'];
147
+
148
+ return (
149
+ // Starts with.
150
+ fs_starts_with( $subdomain, 'local.' ) ||
151
+ fs_starts_with( $subdomain, 'dev.' ) ||
152
+ fs_starts_with( $subdomain, 'test.' ) ||
153
+ fs_starts_with( $subdomain, 'stage.' ) ||
154
+ fs_starts_with( $subdomain, 'staging.' ) ||
155
+
156
+ // Ends with.
157
+ fs_ends_with( $subdomain, '.dev' ) ||
158
+ fs_ends_with( $subdomain, '.test' ) ||
159
+ fs_ends_with( $subdomain, '.staging' ) ||
160
+ fs_ends_with( $subdomain, '.local' ) ||
161
+ fs_ends_with( $subdomain, '.example' ) ||
162
+ fs_ends_with( $subdomain, '.invalid' ) ||
163
+ // GoDaddy test/dev.
164
+ fs_ends_with( $subdomain, '.myftpupload.com' ) ||
165
+ // ngrok tunneling.
166
+ fs_ends_with( $subdomain, '.ngrok.io' ) ||
167
+ // wpsandbox.
168
+ fs_ends_with( $subdomain, '.wpsandbox.pro' ) ||
169
+ // SiteGround staging.
170
+ fs_starts_with( $subdomain, 'staging' ) ||
171
+ // WPEngine staging.
172
+ fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
173
+ // Pantheon
174
+ ( fs_ends_with($subdomain, 'pantheonsite.io') &&
175
+ (fs_starts_with($subdomain, 'test-') || fs_starts_with($subdomain, 'dev-'))) ||
176
+ // Cloudways
177
+ fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
178
+ // Kinsta
179
+ (fs_ends_with($subdomain, '.kinsta.com') && fs_starts_with($subdomain, 'staging-'))
180
+ );
181
+ }
182
+
183
+ function is_localhost() {
184
+ return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
185
+ }
186
+
187
+ /**
188
+ * Check if site in trial.
189
+ *
190
+ * @author Vova Feldman (@svovaf)
191
+ * @since 1.0.9
192
+ *
193
+ * @return bool
194
+ */
195
+ function is_trial() {
196
+ return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
197
+ }
198
+
199
+ /**
200
+ * Check if user already utilized the trial with the current install.
201
+ *
202
+ * @author Vova Feldman (@svovaf)
203
+ * @since 1.0.9
204
+ *
205
+ * @return bool
206
+ */
207
+ function is_trial_utilized() {
208
+ return is_numeric( $this->trial_plan_id );
209
+ }
210
+
211
+ /**
212
+ * @author Vova Feldman (@svovaf)
213
+ * @since 2.0.0
214
+ *
215
+ * @return bool
216
+ */
217
+ function is_tracking_allowed() {
218
+ return ( true !== $this->is_disconnected );
219
+ }
220
+
221
+ /**
222
+ * @author Vova Feldman (@svovaf)
223
+ * @since 2.0.0
224
+ *
225
+ * @return bool
226
+ */
227
+ function is_tracking_prohibited() {
228
+ return ! $this->is_tracking_allowed();
229
+ }
230
  }
includes/pum-sdk/freemius/includes/entities/class-fs-subscription.php CHANGED
@@ -1,125 +1,125 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.9
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Subscription extends FS_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var number
19
- */
20
- public $user_id;
21
- /**
22
- * @var number
23
- */
24
- public $install_id;
25
- /**
26
- * @var number
27
- */
28
- public $plan_id;
29
- /**
30
- * @var number
31
- */
32
- public $license_id;
33
- /**
34
- * @var float
35
- */
36
- public $total_gross;
37
- /**
38
- * @var float
39
- */
40
- public $amount_per_cycle;
41
- /**
42
- * @var int # of months
43
- */
44
- public $billing_cycle;
45
- /**
46
- * @var float
47
- */
48
- public $outstanding_balance;
49
- /**
50
- * @var int
51
- */
52
- public $failed_payments;
53
- /**
54
- * @var string
55
- */
56
- public $gateway;
57
- /**
58
- * @var string
59
- */
60
- public $external_id;
61
- /**
62
- * @var string|null
63
- */
64
- public $trial_ends;
65
- /**
66
- * @var string|null Datetime of the next payment, or null if cancelled
67
- */
68
- public $next_payment;
69
- /**
70
- * @var string|null
71
- */
72
- public $vat_id;
73
- /**
74
- * @var string Two characters country code
75
- */
76
- public $country_code;
77
-
78
- #endregion Properties
79
-
80
- /**
81
- * @param object|bool $subscription
82
- */
83
- function __construct( $subscription = false ) {
84
- parent::__construct( $subscription );
85
- }
86
-
87
- static function get_type() {
88
- return 'subscription';
89
- }
90
-
91
- /**
92
- * Check if subscription is active.
93
- *
94
- * @author Vova Feldman (@svovaf)
95
- * @since 1.0.9
96
- *
97
- * @return bool
98
- */
99
- function is_active() {
100
- return ! empty( $this->next_payment ) &&
101
- ( strtotime( $this->next_payment ) > WP_FS__SCRIPT_START_TIME );
102
- }
103
-
104
- /**
105
- * Subscription considered to be new without any payments
106
- * if the next payment should be made within less than 24 hours
107
- * from the subscription creation.
108
- *
109
- * @author Vova Feldman (@svovaf)
110
- * @since 1.0.9
111
- *
112
- * @return bool
113
- */
114
- function is_first_payment_pending() {
115
- return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->next_payment ) - strtotime( $this->created ) );
116
- }
117
-
118
- /**
119
- * @author Vova Feldman (@svovaf)
120
- * @since 1.1.7
121
- */
122
- function has_trial() {
123
- return ! is_null( $this->trial_ends );
124
- }
125
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.9
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Subscription extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $user_id;
21
+ /**
22
+ * @var number
23
+ */
24
+ public $install_id;
25
+ /**
26
+ * @var number
27
+ */
28
+ public $plan_id;
29
+ /**
30
+ * @var number
31
+ */
32
+ public $license_id;
33
+ /**
34
+ * @var float
35
+ */
36
+ public $total_gross;
37
+ /**
38
+ * @var float
39
+ */
40
+ public $amount_per_cycle;
41
+ /**
42
+ * @var int # of months
43
+ */
44
+ public $billing_cycle;
45
+ /**
46
+ * @var float
47
+ */
48
+ public $outstanding_balance;
49
+ /**
50
+ * @var int
51
+ */
52
+ public $failed_payments;
53
+ /**
54
+ * @var string
55
+ */
56
+ public $gateway;
57
+ /**
58
+ * @var string
59
+ */
60
+ public $external_id;
61
+ /**
62
+ * @var string|null
63
+ */
64
+ public $trial_ends;
65
+ /**
66
+ * @var string|null Datetime of the next payment, or null if cancelled
67
+ */
68
+ public $next_payment;
69
+ /**
70
+ * @var string|null
71
+ */
72
+ public $vat_id;
73
+ /**
74
+ * @var string Two characters country code
75
+ */
76
+ public $country_code;
77
+
78
+ #endregion Properties
79
+
80
+ /**
81
+ * @param object|bool $subscription
82
+ */
83
+ function __construct( $subscription = false ) {
84
+ parent::__construct( $subscription );
85
+ }
86
+
87
+ static function get_type() {
88
+ return 'subscription';
89
+ }
90
+
91
+ /**
92
+ * Check if subscription is active.
93
+ *
94
+ * @author Vova Feldman (@svovaf)
95
+ * @since 1.0.9
96
+ *
97
+ * @return bool
98
+ */
99
+ function is_active() {
100
+ return ! empty( $this->next_payment ) &&
101
+ ( strtotime( $this->next_payment ) > WP_FS__SCRIPT_START_TIME );
102
+ }
103
+
104
+ /**
105
+ * Subscription considered to be new without any payments
106
+ * if the next payment should be made within less than 24 hours
107
+ * from the subscription creation.
108
+ *
109
+ * @author Vova Feldman (@svovaf)
110
+ * @since 1.0.9
111
+ *
112
+ * @return bool
113
+ */
114
+ function is_first_payment_pending() {
115
+ return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->next_payment ) - strtotime( $this->created ) );
116
+ }
117
+
118
+ /**
119
+ * @author Vova Feldman (@svovaf)
120
+ * @since 1.1.7
121
+ */
122
+ function has_trial() {
123
+ return ! is_null( $this->trial_ends );
124
+ }
125
  }
includes/pum-sdk/freemius/includes/entities/class-fs-user.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_User extends FS_Scope_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var string
19
- */
20
- public $email;
21
- /**
22
- * @var string
23
- */
24
- public $first;
25
- /**
26
- * @var string
27
- */
28
- public $last;
29
- /**
30
- * @var bool
31
- */
32
- public $is_verified;
33
- /**
34
- * @var string|null
35
- */
36
- public $customer_id;
37
- /**
38
- * @var float
39
- */
40
- public $gross;
41
-
42
- #endregion Properties
43
-
44
- /**
45
- * @param object|bool $user
46
- */
47
- function __construct( $user = false ) {
48
- parent::__construct( $user );
49
- }
50
-
51
- function get_name() {
52
- return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
53
- }
54
-
55
- function is_verified() {
56
- return ( isset( $this->is_verified ) && true === $this->is_verified );
57
- }
58
-
59
- static function get_type() {
60
- return 'user';
61
- }
62
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_User extends FS_Scope_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var string
19
+ */
20
+ public $email;
21
+ /**
22
+ * @var string
23
+ */
24
+ public $first;
25
+ /**
26
+ * @var string
27
+ */
28
+ public $last;
29
+ /**
30
+ * @var bool
31
+ */
32
+ public $is_verified;
33
+ /**
34
+ * @var string|null
35
+ */
36
+ public $customer_id;
37
+ /**
38
+ * @var float
39
+ */
40
+ public $gross;
41
+
42
+ #endregion Properties
43
+
44
+ /**
45
+ * @param object|bool $user
46
+ */
47
+ function __construct( $user = false ) {
48
+ parent::__construct( $user );
49
+ }
50
+
51
+ function get_name() {
52
+ return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
53
+ }
54
+
55
+ function is_verified() {
56
+ return ( isset( $this->is_verified ) && true === $this->is_verified );
57
+ }
58
+
59
+ static function get_type() {
60
+ return 'user';
61
+ }
62
  }
includes/pum-sdk/freemius/includes/entities/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/fs-core-functions.php CHANGED
@@ -86,9 +86,25 @@
86
  function fs_asset_url( $asset_abs_path ) {
87
  $wp_content_dir = fs_normalize_path( WP_CONTENT_DIR );
88
  $asset_abs_path = fs_normalize_path( $asset_abs_path );
89
- $asset_rel_path = str_replace( $wp_content_dir, '', $asset_abs_path );
90
 
91
- $asset_url = content_url( fs_normalize_path( $asset_rel_path ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
  return $asset_url;
94
  }
@@ -709,6 +725,97 @@
709
  return $key;
710
  }
711
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
  /**
713
  * Get a translatable text override if exists, or `false`.
714
  *
@@ -746,7 +853,9 @@
746
 
747
  return false;
748
  }
 
749
 
 
750
  /**
751
  * Get a translatable text and its text domain.
752
  *
@@ -776,9 +885,9 @@
776
 
777
  return array( $text, $text_domain );
778
  }
 
779
 
780
- #region Private
781
-
782
  /**
783
  * Retrieve an inline translated text by key.
784
  *
@@ -801,33 +910,9 @@
801
 
802
  return $fn( $text, $text_domain );
803
  }
 
804
 
805
- /**
806
- * Retrieve an inline translated text by key with a context.
807
- *
808
- * @author Vova Feldman (@svovaf)
809
- * @since 1.2.3
810
- *
811
- * @param string $text Translatable string.
812
- * @param string $context Context information for the translators.
813
- * @param string $key String key for overrides.
814
- * @param string $slug Module slug for overrides.
815
- *
816
- * @return string
817
- *
818
- * @global $fs_text_overrides
819
- */
820
- function _fs_text_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
821
- list( $text, $text_domain ) = fs_text_and_domain( $text, $key, $slug );
822
-
823
- // Avoid misleading Theme Check warning.
824
- $fn = 'translate_with_gettext_context';
825
-
826
- return $fn( $text, $context, $text_domain );
827
- }
828
-
829
- #endregion
830
-
831
  /**
832
  * Retrieve an inline translated text by key.
833
  *
@@ -845,67 +930,6 @@
845
  function fs_text_inline( $text, $key = '', $slug = 'freemius' ) {
846
  return _fs_text_inline( $text, $key, $slug );
847
  }
848
-
849
- /**
850
- * Retrieve an inline translated text by key with a context.
851
- *
852
- * @author Vova Feldman (@svovaf)
853
- * @since 1.2.3
854
- *
855
- * @param string $text Translatable string.
856
- * @param string $context Context information for the translators.
857
- * @param string $key String key for overrides.
858
- * @param string $slug Module slug for overrides.
859
- *
860
- * @return string
861
- *
862
- * @global $fs_text_overrides
863
- */
864
- function fs_text_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
865
- return _fs_text_x_inline( $text, $context, $key, $slug );
866
- }
867
-
868
- /**
869
- * Output a translated text by key.
870
- *
871
- * @author Vova Feldman (@svovaf)
872
- * @since 1.2.1.7
873
- *
874
- * @param string $key
875
- * @param string $slug
876
- */
877
- function fs_echo( $key, $slug = 'freemius' ) {
878
- echo fs_text( $key, $slug );
879
- }
880
-
881
- /**
882
- * Output an inline translated text.
883
- *
884
- * @author Vova Feldman (@svovaf)
885
- * @since 1.2.3
886
- *
887
- * @param string $text Translatable string.
888
- * @param string $key String key for overrides.
889
- * @param string $slug Module slug for overrides.
890
- */
891
- function fs_echo_inline( $text, $key = '', $slug = 'freemius' ) {
892
- echo _fs_text_inline( $text, $key, $slug );
893
- }
894
-
895
- /**
896
- * Output an inline translated text with a context.
897
- *
898
- * @author Vova Feldman (@svovaf)
899
- * @since 1.2.3
900
- *
901
- * @param string $text Translatable string.
902
- * @param string $context Context information for the translators.
903
- * @param string $key String key for overrides.
904
- * @param string $slug Module slug for overrides.
905
- */
906
- function fs_echo_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
907
- echo _fs_text_x_inline( $text, $context, $key, $slug );
908
- }
909
  }
910
 
911
  if ( ! function_exists( 'fs_esc_attr' ) ) {
86
  function fs_asset_url( $asset_abs_path ) {
87
  $wp_content_dir = fs_normalize_path( WP_CONTENT_DIR );
88
  $asset_abs_path = fs_normalize_path( $asset_abs_path );
 
89
 
90
+ if ( 0 === strpos( $asset_abs_path, $wp_content_dir ) ) {
91
+ // Handle both theme and plugin assets located in the standard directories.
92
+ $asset_rel_path = str_replace( $wp_content_dir, '', $asset_abs_path );
93
+ $asset_url = content_url( fs_normalize_path( $asset_rel_path ) );
94
+ } else {
95
+ $wp_plugins_dir = fs_normalize_path( WP_PLUGIN_DIR );
96
+ if ( 0 === strpos( $asset_abs_path, $wp_plugins_dir ) ) {
97
+ // Try to handle plugin assets that may be located in a non-standard plugins directory.
98
+ $asset_rel_path = str_replace( $wp_plugins_dir, '', $asset_abs_path );
99
+ $asset_url = plugins_url( fs_normalize_path( $asset_rel_path ) );
100
+ } else {
101
+ // Try to handle theme assets that may be located in a non-standard themes directory.
102
+ $active_theme_stylesheet = get_stylesheet();
103
+ $wp_themes_dir = fs_normalize_path( trailingslashit( get_theme_root( $active_theme_stylesheet ) ) );
104
+ $asset_rel_path = str_replace( $wp_themes_dir, '', fs_normalize_path( $asset_abs_path ) );
105
+ $asset_url = trailingslashit( get_theme_root_uri( $active_theme_stylesheet ) ) . fs_normalize_path( $asset_rel_path );
106
+ }
107
+ }
108
 
109
  return $asset_url;
110
  }
725
  return $key;
726
  }
727
 
728
+ #region Private
729
+
730
+ /**
731
+ * Retrieve an inline translated text by key with a context.
732
+ *
733
+ * @author Vova Feldman (@svovaf)
734
+ * @since 1.2.3
735
+ *
736
+ * @param string $text Translatable string.
737
+ * @param string $context Context information for the translators.
738
+ * @param string $key String key for overrides.
739
+ * @param string $slug Module slug for overrides.
740
+ *
741
+ * @return string
742
+ *
743
+ * @global $fs_text_overrides
744
+ */
745
+ function _fs_text_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
746
+ list( $text, $text_domain ) = fs_text_and_domain( $text, $key, $slug );
747
+
748
+ // Avoid misleading Theme Check warning.
749
+ $fn = 'translate_with_gettext_context';
750
+
751
+ return $fn( $text, $context, $text_domain );
752
+ }
753
+
754
+ #endregion
755
+
756
+ /**
757
+ * Retrieve an inline translated text by key with a context.
758
+ *
759
+ * @author Vova Feldman (@svovaf)
760
+ * @since 1.2.3
761
+ *
762
+ * @param string $text Translatable string.
763
+ * @param string $context Context information for the translators.
764
+ * @param string $key String key for overrides.
765
+ * @param string $slug Module slug for overrides.
766
+ *
767
+ * @return string
768
+ *
769
+ * @global $fs_text_overrides
770
+ */
771
+ function fs_text_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
772
+ return _fs_text_x_inline( $text, $context, $key, $slug );
773
+ }
774
+
775
+ /**
776
+ * Output a translated text by key.
777
+ *
778
+ * @author Vova Feldman (@svovaf)
779
+ * @since 1.2.1.7
780
+ *
781
+ * @param string $key
782
+ * @param string $slug
783
+ */
784
+ function fs_echo( $key, $slug = 'freemius' ) {
785
+ echo fs_text( $key, $slug );
786
+ }
787
+
788
+ /**
789
+ * Output an inline translated text.
790
+ *
791
+ * @author Vova Feldman (@svovaf)
792
+ * @since 1.2.3
793
+ *
794
+ * @param string $text Translatable string.
795
+ * @param string $key String key for overrides.
796
+ * @param string $slug Module slug for overrides.
797
+ */
798
+ function fs_echo_inline( $text, $key = '', $slug = 'freemius' ) {
799
+ echo _fs_text_inline( $text, $key, $slug );
800
+ }
801
+
802
+ /**
803
+ * Output an inline translated text with a context.
804
+ *
805
+ * @author Vova Feldman (@svovaf)
806
+ * @since 1.2.3
807
+ *
808
+ * @param string $text Translatable string.
809
+ * @param string $context Context information for the translators.
810
+ * @param string $key String key for overrides.
811
+ * @param string $slug Module slug for overrides.
812
+ */
813
+ function fs_echo_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
814
+ echo _fs_text_x_inline( $text, $context, $key, $slug );
815
+ }
816
+ }
817
+
818
+ if ( ! function_exists( 'fs_text_override' ) ) {
819
  /**
820
  * Get a translatable text override if exists, or `false`.
821
  *
853
 
854
  return false;
855
  }
856
+ }
857
 
858
+ if ( ! function_exists( 'fs_text_and_domain' ) ) {
859
  /**
860
  * Get a translatable text and its text domain.
861
  *
885
 
886
  return array( $text, $text_domain );
887
  }
888
+ }
889
 
890
+ if ( ! function_exists( '_fs_text_inline' ) ) {
 
891
  /**
892
  * Retrieve an inline translated text by key.
893
  *
910
 
911
  return $fn( $text, $text_domain );
912
  }
913
+ }
914
 
915
+ if ( ! function_exists( 'fs_text_inline' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
916
  /**
917
  * Retrieve an inline translated text by key.
918
  *
930
  function fs_text_inline( $text, $key = '', $slug = 'freemius' ) {
931
  return _fs_text_inline( $text, $key, $slug );
932
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
933
  }
934
 
935
  if ( ! function_exists( 'fs_esc_attr' ) ) {
includes/pum-sdk/freemius/includes/fs-essential-functions.php CHANGED
@@ -36,6 +36,8 @@
36
  }
37
  }
38
 
 
 
39
  #region Core Redirect (copied from BuddyPress) -----------------------------------------
40
 
41
  if ( ! function_exists( 'fs_redirect' ) ) {
@@ -273,11 +275,11 @@
273
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
274
  }
275
 
276
- $all_plugins = get_plugins();
277
  $all_plugins_paths = array();
278
 
279
  // Get active plugin's main files real full names (might be symlinks).
280
- foreach ( $all_plugins as $relative_path => &$data ) {
281
  $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
282
  }
283
 
36
  }
37
  }
38
 
39
+ require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-2.2.1.php';
40
+
41
  #region Core Redirect (copied from BuddyPress) -----------------------------------------
42
 
43
  if ( ! function_exists( 'fs_redirect' ) ) {
275
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
276
  }
277
 
278
+ $all_plugins = fs_get_plugins( true );
279
  $all_plugins_paths = array();
280
 
281
  // Get active plugin's main files real full names (might be symlinks).
282
+ foreach ( $all_plugins as $relative_path => $data ) {
283
  $all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
284
  }
285
 
includes/pum-sdk/freemius/includes/fs-plugin-info-dialog.php CHANGED
@@ -64,7 +64,7 @@
64
  function _get_addon_info_filter( $data, $action = '', $args = null ) {
65
  $this->_logger->entrance();
66
 
67
- $parent_plugin_id = fs_request_get( 'parent_plugin_id', false );
68
 
69
  if ( $this->_fs->get_id() != $parent_plugin_id ||
70
  ( 'plugin_information' !== $action ) ||
@@ -101,7 +101,7 @@
101
  $has_features = false;
102
  $plans = false;
103
 
104
- $result = $this->_fs->get_api_plugin_scope()->get( "/addons/{$selected_addon->id}/pricing.json?type=visible" );
105
 
106
  if ( ! isset( $result->error ) ) {
107
  $plans = $result->plans;
@@ -142,6 +142,8 @@
142
  }
143
  }
144
 
 
 
145
  if ( ! $has_paid_plan && $selected_addon->is_wp_org_compliant ) {
146
  $repo_data = FS_Plugin_Updater::_fetch_plugin_info_from_repository(
147
  'plugin_information', (object) array(
@@ -165,11 +167,33 @@
165
  // Plugin is missing, not on Freemius nor WP.org.
166
  $data->wp_org_missing = true;
167
  }
 
 
168
  } else {
169
  $data->wp_org_missing = false;
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  // Fetch latest version from Freemius.
172
- $latest = $this->_fs->_fetch_latest_version( $selected_addon->id );
 
 
 
 
 
173
 
174
  if ( $has_paid_plan ) {
175
  $data->checkout_link = $this->_fs->checkout_url();
@@ -183,12 +207,7 @@
183
 
184
  // Fetch as much as possible info from local files.
185
  $plugin_local_data = $this->_fs->get_plugin_data();
186
- $data->name = $selected_addon->title;
187
  $data->author = $plugin_local_data['Author'];
188
- $view_vars = array( 'plugin' => $selected_addon );
189
- $data->sections = array(
190
- 'description' => fs_get_template( '/plugin-info/description.php', $view_vars ),
191
- );
192
 
193
  if ( ! empty( $selected_addon->info->banner_url ) ) {
194
  $data->banners = array(
@@ -206,7 +225,7 @@
206
 
207
  if ( is_object( $latest ) ) {
208
  $data->version = $latest->version;
209
- $data->last_updated = ! is_null( $latest->updated ) ? $latest->updated : $latest->created;
210
  $data->requires = $latest->requires_platform_version;
211
  $data->tested = $latest->tested_up_to_version;
212
  } else {
@@ -217,6 +236,20 @@
217
  }
218
  }
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  if ( $has_pricing ) {
221
  // Add plans to data.
222
  $data->plans = $plans;
@@ -950,7 +983,7 @@
950
  </li>
951
  <?php
952
  }
953
- if ( ! empty( $api->slug ) && empty( $api->is_wp_org_compliant ) ) {
954
  ?>
955
  <li><a target="_blank"
956
  href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php fs_esc_html_echo_inline( 'WordPress.org Plugin Page', 'wp-org-plugin-page', $api->slug ) ?>
@@ -1094,7 +1127,7 @@
1094
  echo "</div>\n"; // #plugin-information-scrollable
1095
  echo "<div id='$tab-footer'>\n";
1096
 
1097
- if ( ! empty( $api->checkout_link ) ) {
1098
  echo $this->get_checkout_cta( $api );
1099
  }
1100
 
64
  function _get_addon_info_filter( $data, $action = '', $args = null ) {
65
  $this->_logger->entrance();
66
 
67
+ $parent_plugin_id = fs_request_get( 'parent_plugin_id', $this->_fs->get_id() );
68
 
69
  if ( $this->_fs->get_id() != $parent_plugin_id ||
70
  ( 'plugin_information' !== $action ) ||
101
  $has_features = false;
102
  $plans = false;
103
 
104
+ $result = $this->_fs->get_api_plugin_scope()->get( $this->_fs->add_show_pending( "/addons/{$selected_addon->id}/pricing.json?type=visible" ) );
105
 
106
  if ( ! isset( $result->error ) ) {
107
  $plans = $result->plans;
142
  }
143
  }
144
 
145
+ $latest = null;
146
+
147
  if ( ! $has_paid_plan && $selected_addon->is_wp_org_compliant ) {
148
  $repo_data = FS_Plugin_Updater::_fetch_plugin_info_from_repository(
149
  'plugin_information', (object) array(
167
  // Plugin is missing, not on Freemius nor WP.org.
168
  $data->wp_org_missing = true;
169
  }
170
+
171
+ $data->fs_missing = ( ! $has_free_plan || $data->wp_org_missing );
172
  } else {
173
  $data->wp_org_missing = false;
174
 
175
+ $current_addon_version = false;
176
+ if ( $this->_fs->is_addon_activated( $selected_addon->id ) ) {
177
+ $current_addon_version = $this->_fs->get_addon_instance( $selected_addon->id )->get_plugin_version();
178
+ } else if ( $this->_fs->is_addon_installed( $selected_addon->id ) ) {
179
+ $addon_plugin_data = get_plugin_data(
180
+ ( WP_PLUGIN_DIR . '/' . $this->_fs->get_addon_basename( $selected_addon->id ) ),
181
+ false,
182
+ false
183
+ );
184
+
185
+ if ( ! empty( $addon_plugin_data ) ) {
186
+ $current_addon_version = $addon_plugin_data['Version'];
187
+ }
188
+ }
189
+
190
  // Fetch latest version from Freemius.
191
+ $latest = $this->_fs->_fetch_latest_version(
192
+ $selected_addon->id,
193
+ true,
194
+ WP_FS__TIME_24_HOURS_IN_SEC,
195
+ $current_addon_version
196
+ );
197
 
198
  if ( $has_paid_plan ) {
199
  $data->checkout_link = $this->_fs->checkout_url();
207
 
208
  // Fetch as much as possible info from local files.
209
  $plugin_local_data = $this->_fs->get_plugin_data();
 
210
  $data->author = $plugin_local_data['Author'];
 
 
 
 
211
 
212
  if ( ! empty( $selected_addon->info->banner_url ) ) {
213
  $data->banners = array(
225
 
226
  if ( is_object( $latest ) ) {
227
  $data->version = $latest->version;
228
+ $data->last_updated = $latest->created;
229
  $data->requires = $latest->requires_platform_version;
230
  $data->tested = $latest->tested_up_to_version;
231
  } else {
236
  }
237
  }
238
 
239
+ $data->name = $selected_addon->title;
240
+ $view_vars = array( 'plugin' => $selected_addon );
241
+
242
+ if ( is_object( $latest ) && isset( $latest->readme ) && is_object( $latest->readme ) ) {
243
+ $latest_version_readme_data = $latest->readme;
244
+ if ( isset( $latest_version_readme_data->sections ) ) {
245
+ $data->sections = (array) $latest_version_readme_data->sections;
246
+ } else {
247
+ $data->sections = array();
248
+ }
249
+ }
250
+
251
+ $data->sections['description'] = fs_get_template( '/plugin-info/description.php', $view_vars );
252
+
253
  if ( $has_pricing ) {
254
  // Add plans to data.
255
  $data->plans = $plans;
983
  </li>
984
  <?php
985
  }
986
+ if ( ! empty( $api->slug ) && true == $api->is_wp_org_compliant ) {
987
  ?>
988
  <li><a target="_blank"
989
  href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php fs_esc_html_echo_inline( 'WordPress.org Plugin Page', 'wp-org-plugin-page', $api->slug ) ?>
1127
  echo "</div>\n"; // #plugin-information-scrollable
1128
  echo "<div id='$tab-footer'>\n";
1129
 
1130
+ if ( $api->has_paid_plan && ! empty( $api->checkout_link ) ) {
1131
  echo $this->get_checkout_cta( $api );
1132
  }
1133
 
includes/pum-sdk/freemius/includes/i18n.php CHANGED
@@ -94,7 +94,7 @@
94
  'activate-x-now' => _fs_x( 'Complete "%s" Activation Now',
95
  '%s - plugin name. As complete "Jetpack" activation now' ),
96
  'few-plugin-tweaks' => _fs_text( 'We made a few tweaks to the %s, %s' ),
97
- 'optin-x-now' => _fs_text( 'Opt in to make "%s" Better!' ),
98
  'error' => _fs_text( 'Error' ),
99
  'failed-finding-main-path' => _fs_text( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.' ),
100
  'learn-more' => _fs_text( 'Learn more' ),
@@ -215,7 +215,7 @@
215
  'delete-account-confirm' => _fs_text( 'Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?' ),
216
  'downgrade-x-confirm' => _fs_text( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.' ),
217
  'cancel-trial-confirm' => _fs_text( 'Cancelling the trial will immediately block access to all premium features. Are you sure?' ),
218
- 'after-downgrade-non-blocking' => _fs_text( 'You can still enjoy all %s features but you will not have access to %s updates and support.' ),
219
  'after-downgrade-blocking' => _fs_text( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.' ),
220
  'proceed-confirmation' => _fs_text( 'Are you sure you want to proceed?' ),
221
  #endregion Account
@@ -600,4 +600,4 @@
600
  'not-compatible-warning' => _fs_text( 'This plugin has not been marked as compatible with your version of WordPress.' ),
601
  'newer-installed' => _fs_text( 'Newer Version (%s) Installed' ),
602
  'latest-installed' => _fs_text( 'Latest Version Installed' ),
603
- );
94
  'activate-x-now' => _fs_x( 'Complete "%s" Activation Now',
95
  '%s - plugin name. As complete "Jetpack" activation now' ),
96
  'few-plugin-tweaks' => _fs_text( 'We made a few tweaks to the %s, %s' ),
97
+ 'optin-x-now' => _fs_text( 'Opt in to make "%s" better!' ),
98
  'error' => _fs_text( 'Error' ),
99
  'failed-finding-main-path' => _fs_text( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.' ),
100
  'learn-more' => _fs_text( 'Learn more' ),
215
  'delete-account-confirm' => _fs_text( 'Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?' ),
216
  'downgrade-x-confirm' => _fs_text( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.' ),
217
  'cancel-trial-confirm' => _fs_text( 'Cancelling the trial will immediately block access to all premium features. Are you sure?' ),
218
+ 'after-downgrade-non-blocking' => _fs_text( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.' ),
219
  'after-downgrade-blocking' => _fs_text( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.' ),
220
  'proceed-confirmation' => _fs_text( 'Are you sure you want to proceed?' ),
221
  #endregion Account
600
  'not-compatible-warning' => _fs_text( 'This plugin has not been marked as compatible with your version of WordPress.' ),
601
  'newer-installed' => _fs_text( 'Newer Version (%s) Installed' ),
602
  'latest-installed' => _fs_text( 'Latest Version Installed' ),
603
+ );
includes/pum-sdk/freemius/includes/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/l10n.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.1.6
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Retrieve the translation of $text.
15
- *
16
- * @since 1.2.1.6
17
- *
18
- * @param string $text
19
- *
20
- * @return string
21
- */
22
- function _fs_text( $text ) {
23
- // Avoid misleading Theme Check warning.
24
- $fn = 'translate';
25
- return $fn( $text, 'freemius' );
26
- }
27
-
28
- /**
29
- * Retrieve translated string with gettext context.
30
- *
31
- * Quite a few times, there will be collisions with similar translatable text
32
- * found in more than two places, but with different translated context.
33
- *
34
- * By including the context in the pot file, translators can translate the two
35
- * strings differently.
36
- *
37
- * @since 1.2.1.6
38
- *
39
- * @param string $text
40
- * @param string $context
41
- *
42
- * @return string
43
- */
44
- function _fs_x( $text, $context ) {
45
- // Avoid misleading Theme Check warning.
46
- $fn = 'translate_with_gettext_context';
47
- return $fn( $text, $context, 'freemius' );
48
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.1.6
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Retrieve the translation of $text.
15
+ *
16
+ * @since 1.2.1.6
17
+ *
18
+ * @param string $text
19
+ *
20
+ * @return string
21
+ */
22
+ function _fs_text( $text ) {
23
+ // Avoid misleading Theme Check warning.
24
+ $fn = 'translate';
25
+ return $fn( $text, 'freemius' );
26
+ }
27
+
28
+ /**
29
+ * Retrieve translated string with gettext context.
30
+ *
31
+ * Quite a few times, there will be collisions with similar translatable text
32
+ * found in more than two places, but with different translated context.
33
+ *
34
+ * By including the context in the pot file, translators can translate the two
35
+ * strings differently.
36
+ *
37
+ * @since 1.2.1.6
38
+ *
39
+ * @param string $text
40
+ * @param string $context
41
+ *
42
+ * @return string
43
+ */
44
+ function _fs_x( $text, $context ) {
45
+ // Avoid misleading Theme Check warning.
46
+ $fn = 'translate_with_gettext_context';
47
+ return $fn( $text, $context, 'freemius' );
48
+ }
includes/pum-sdk/freemius/includes/managers/class-fs-admin-menu-manager.php CHANGED
@@ -1,957 +1,969 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Admin_Menu_Manager {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @since 1.2.2
19
- *
20
- * @var string
21
- */
22
- protected $_module_unique_affix;
23
-
24
- /**
25
- * @since 1.2.2
26
- *
27
- * @var number
28
- */
29
- protected $_module_id;
30
-
31
- /**
32
- * @since 1.2.2
33
- *
34
- * @var string
35
- */
36
- protected $_module_type;
37
-
38
- /**
39
- * @since 1.0.6
40
- *
41
- * @var string
42
- */
43
- private $_menu_slug;
44
- /**
45
- * @since 1.1.3
46
- *
47
- * @var string
48
- */
49
- private $_parent_slug;
50
- /**
51
- * @since 1.1.3
52
- *
53
- * @var string
54
- */
55
- private $_parent_type;
56
- /**
57
- * @since 1.1.3
58
- *
59
- * @var string
60
- */
61
- private $_type;
62
- /**
63
- * @since 1.1.3
64
- *
65
- * @var bool
66
- */
67
- private $_is_top_level;
68
- /**
69
- * @since 1.1.3
70
- *
71
- * @var bool
72
- */
73
- private $_is_override_exact;
74
- /**
75
- * @since 1.1.3
76
- *
77
- * @var array<string,bool>
78
- */
79
- private $_default_submenu_items;
80
- /**
81
- * @since 1.1.3
82
- *
83
- * @var string
84
- */
85
- private $_first_time_path;
86
- /**
87
- * @since 1.2.2
88
- *
89
- * @var bool
90
- */
91
- private $_menu_exists;
92
- /**
93
- * @since 2.0.0
94
- *
95
- * @var bool
96
- */
97
- private $_network_menu_exists;
98
-
99
- #endregion Properties
100
-
101
- /**
102
- * @var FS_Logger
103
- */
104
- protected $_logger;
105
-
106
- #region Singleton
107
-
108
- /**
109
- * @var FS_Admin_Menu_Manager[]
110
- */
111
- private static $_instances = array();
112
-
113
- /**
114
- * @param number $module_id
115
- * @param string $module_type
116
- * @param string $module_unique_affix
117
- *
118
- * @return FS_Admin_Menu_Manager
119
- */
120
- static function instance( $module_id, $module_type, $module_unique_affix ) {
121
- $key = 'm_' . $module_id;
122
-
123
- if ( ! isset( self::$_instances[ $key ] ) ) {
124
- self::$_instances[ $key ] = new FS_Admin_Menu_Manager( $module_id, $module_type, $module_unique_affix );
125
- }
126
-
127
- return self::$_instances[ $key ];
128
- }
129
-
130
- protected function __construct( $module_id, $module_type, $module_unique_affix ) {
131
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
132
-
133
- $this->_module_id = $module_id;
134
- $this->_module_type = $module_type;
135
- $this->_module_unique_affix = $module_unique_affix;
136
- }
137
-
138
- #endregion Singleton
139
-
140
- #region Helpers
141
-
142
- private function get_option( &$options, $key, $default = false ) {
143
- return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
144
- }
145
-
146
- private function get_bool_option( &$options, $key, $default = false ) {
147
- return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
148
- }
149
-
150
- #endregion Helpers
151
-
152
- /**
153
- * @param array $menu
154
- * @param bool $is_addon
155
- */
156
- function init( $menu, $is_addon = false ) {
157
- $this->_menu_exists = ( isset( $menu['slug'] ) && ! empty( $menu['slug'] ) );
158
- $this->_network_menu_exists = ( ! empty( $menu['network'] ) && true === $menu['network'] );
159
-
160
- $this->_menu_slug = ( $this->_menu_exists ? $menu['slug'] : $this->_module_unique_affix );
161
-
162
- $this->_default_submenu_items = array();
163
- // @deprecated
164
- $this->_type = 'page';
165
- $this->_is_top_level = true;
166
- $this->_is_override_exact = false;
167
- $this->_parent_slug = false;
168
- // @deprecated
169
- $this->_parent_type = 'page';
170
-
171
- if ( isset( $menu ) ) {
172
- if ( ! $is_addon ) {
173
- $this->_default_submenu_items = array(
174
- 'contact' => $this->get_bool_option( $menu, 'contact', true ),
175
- 'support' => $this->get_bool_option( $menu, 'support', true ),
176
- 'affiliation' => $this->get_bool_option( $menu, 'affiliation', true ),
177
- 'account' => $this->get_bool_option( $menu, 'account', true ),
178
- 'pricing' => $this->get_bool_option( $menu, 'pricing', true ),
179
- 'addons' => $this->get_bool_option( $menu, 'addons', true ),
180
- );
181
-
182
- // @deprecated
183
- $this->_type = $this->get_option( $menu, 'type', 'page' );
184
-
185
- $this->_first_time_path = $this->get_option( $menu, 'first-path', false );
186
- if ( ! empty( $this->_first_time_path ) && is_string( $this->_first_time_path ) ) {
187
- $this->_first_time_path = admin_url( $this->_first_time_path, 'admin' );
188
- }
189
- }
190
-
191
- $this->_is_override_exact = $this->get_bool_option( $menu, 'override_exact' );
192
-
193
- if ( isset( $menu['parent'] ) ) {
194
- $this->_parent_slug = $this->get_option( $menu['parent'], 'slug' );
195
- // @deprecated
196
- $this->_parent_type = $this->get_option( $menu['parent'], 'type', 'page' );
197
-
198
- // If parent's slug is different, then it's NOT a top level menu item.
199
- $this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
200
- } else {
201
- /**
202
- * If no parent then top level if:
203
- * - Has custom admin menu ('page')
204
- * - CPT menu type ('cpt')
205
- */
206
- // $this->_is_top_level = in_array( $this->_type, array(
207
- // 'cpt',
208
- // 'page'
209
- // ) );
210
- }
211
- }
212
- }
213
-
214
- /**
215
- * Check if top level menu.
216
- *
217
- * @author Vova Feldman (@svovaf)
218
- * @since 1.1.3
219
- *
220
- * @return bool False if submenu item.
221
- */
222
- function is_top_level() {
223
- return $this->_is_top_level;
224
- }
225
-
226
- /**
227
- * Check if the page should be override on exact URL match.
228
- *
229
- * @author Vova Feldman (@svovaf)
230
- * @since 1.1.3
231
- *
232
- * @return bool False if submenu item.
233
- */
234
- function is_override_exact() {
235
- return $this->_is_override_exact;
236
- }
237
-
238
-
239
- /**
240
- * Get the path of the page the user should be forwarded to after first activation.
241
- *
242
- * @author Vova Feldman (@svovaf)
243
- * @since 1.1.3
244
- *
245
- * @return string
246
- */
247
- function get_first_time_path() {
248
- return $this->_first_time_path;
249
- }
250
-
251
- /**
252
- * Check if plugin's menu item is part of a custom top level menu.
253
- *
254
- * @author Vova Feldman (@svovaf)
255
- * @since 1.1.3
256
- *
257
- * @return bool
258
- */
259
- function has_custom_parent() {
260
- return ! $this->_is_top_level && is_string( $this->_parent_slug );
261
- }
262
-
263
- /**
264
- * @author Leo Fajardo (@leorw)
265
- * @since 1.2.2
266
- *
267
- * @return bool
268
- */
269
- function has_menu() {
270
- return $this->_menu_exists;
271
- }
272
-
273
- /**
274
- * @author Vova Feldman (@svovaf)
275
- * @since 2.0.0
276
- *
277
- * @return bool
278
- */
279
- function has_network_menu() {
280
- return $this->_network_menu_exists;
281
- }
282
-
283
- /**
284
- * @author Vova Feldman (@svovaf)
285
- * @since 1.1.3
286
- *
287
- * @param string $id
288
- * @param bool $default
289
- * @param bool $ignore_menu_existence Since 1.2.2.7 If true, check if the submenu item visible even if there's no parent menu.
290
- *
291
- * @return bool
292
- */
293
- function is_submenu_item_visible( $id, $default = true, $ignore_menu_existence = false ) {
294
- if ( ! $ignore_menu_existence && ! $this->has_menu() ) {
295
- return false;
296
- }
297
-
298
- return fs_apply_filter(
299
- $this->_module_unique_affix,
300
- 'is_submenu_visible',
301
- $this->get_bool_option( $this->_default_submenu_items, $id, $default ),
302
- $id
303
- );
304
- }
305
-
306
- /**
307
- * Calculates admin settings menu slug.
308
- * If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
309
- *
310
- * @author Vova Feldman (@svovaf)
311
- * @since 1.1.3
312
- *
313
- * @param string $page
314
- *
315
- * @return string
316
- */
317
- function get_slug( $page = '' ) {
318
- return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
319
- $this->_menu_slug :
320
- $this->_module_unique_affix ) . ( empty( $page ) ? '' : ( '-' . $page ) );
321
- }
322
-
323
- /**
324
- * @author Vova Feldman (@svovaf)
325
- * @since 1.1.3
326
- *
327
- * @return string
328
- */
329
- function get_parent_slug() {
330
- return $this->_parent_slug;
331
- }
332
-
333
- /**
334
- * @author Vova Feldman (@svovaf)
335
- * @since 1.1.3
336
- *
337
- * @return string
338
- */
339
- function get_type() {
340
- return $this->_type;
341
- }
342
-
343
- /**
344
- * @author Vova Feldman (@svovaf)
345
- * @since 1.1.3
346
- *
347
- * @return bool
348
- */
349
- function is_cpt() {
350
- return ( 0 === strpos( $this->_menu_slug, 'edit.php?post_type=' ) ||
351
- // Back compatibility.
352
- 'cpt' === $this->_type
353
- );
354
- }
355
-
356
- /**
357
- * @author Vova Feldman (@svovaf)
358
- * @since 1.1.3
359
- *
360
- * @return string
361
- */
362
- function get_parent_type() {
363
- return $this->_parent_type;
364
- }
365
-
366
- /**
367
- * @author Vova Feldman (@svovaf)
368
- * @since 1.1.3
369
- *
370
- * @return string
371
- */
372
- function get_raw_slug() {
373
- return $this->_menu_slug;
374
- }
375
-
376
- /**
377
- * Get plugin's original menu slug.
378
- *
379
- * @author Vova Feldman (@svovaf)
380
- * @since 1.1.3
381
- *
382
- * @return string
383
- */
384
- function get_original_menu_slug() {
385
- if ( 'cpt' === $this->_type ) {
386
- return add_query_arg( array(
387
- 'post_type' => $this->_menu_slug
388
- ), 'edit.php' );
389
- }
390
-
391
- if ( false === strpos( $this->_menu_slug, '.php?' ) ) {
392
- return $this->_menu_slug;
393
- } else {
394
- return $this->_module_unique_affix;
395
- }
396
- }
397
-
398
- /**
399
- * @author Vova Feldman (@svovaf)
400
- * @since 1.1.3
401
- *
402
- * @return string
403
- */
404
- function get_top_level_menu_slug() {
405
- return $this->has_custom_parent() ?
406
- $this->get_parent_slug() :
407
- $this->get_raw_slug();
408
- }
409
-
410
- /**
411
- * Is user on plugin's admin activation page.
412
- *
413
- * @author Vova Feldman (@svovaf)
414
- * @since 1.0.8
415
- *
416
- * @return bool
417
- */
418
- function is_main_settings_page() {
419
- if ( $this->_menu_exists &&
420
- ( fs_is_plugin_page( $this->_menu_slug ) || fs_is_plugin_page( $this->_module_unique_affix ) )
421
- ) {
422
- /**
423
- * Module has a settings menu and the context page is the main settings page, so assume it's in
424
- * activation (doesn't really check if already opted-in/skipped or not).
425
- *
426
- * @since 1.2.2
427
- */
428
- return true;
429
- }
430
-
431
- global $pagenow;
432
- if ( ( WP_FS__MODULE_TYPE_THEME === $this->_module_type ) && Freemius::is_themes_page() ) {
433
- /**
434
- * In activation only when show_optin query string param is given.
435
- *
436
- * @since 1.2.2
437
- */
438
- return fs_request_get_bool( $this->_module_unique_affix . '_show_optin' );
439
- }
440
-
441
- return false;
442
- }
443
-
444
- #region Submenu Override
445
-
446
- /**
447
- * Override submenu's action.
448
- *
449
- * @author Vova Feldman (@svovaf)
450
- * @since 1.1.0
451
- *
452
- * @param string $parent_slug
453
- * @param string $menu_slug
454
- * @param callable $function
455
- *
456
- * @return false|string If submenu exist, will return the hook name.
457
- */
458
- function override_submenu_action( $parent_slug, $menu_slug, $function ) {
459
- global $submenu;
460
-
461
- $menu_slug = plugin_basename( $menu_slug );
462
- $parent_slug = plugin_basename( $parent_slug );
463
-
464
- if ( ! isset( $submenu[ $parent_slug ] ) ) {
465
- // Parent menu not exist.
466
- return false;
467
- }
468
-
469
- $found_submenu_item = false;
470
- foreach ( $submenu[ $parent_slug ] as $submenu_item ) {
471
- if ( $menu_slug === $submenu_item[2] ) {
472
- $found_submenu_item = $submenu_item;
473
- break;
474
- }
475
- }
476
-
477
- if ( false === $found_submenu_item ) {
478
- // Submenu item not found.
479
- return false;
480
- }
481
-
482
- // Remove current function.
483
- $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
484
- remove_all_actions( $hookname );
485
-
486
- // Attach new action.
487
- add_action( $hookname, $function );
488
-
489
- return $hookname;
490
- }
491
-
492
- #endregion Submenu Override
493
-
494
- #region Top level menu Override
495
-
496
- /**
497
- * Find plugin's admin dashboard main menu item.
498
- *
499
- * @author Vova Feldman (@svovaf)
500
- * @since 1.0.2
501
- *
502
- * @return string[]|false
503
- */
504
- private function find_top_level_menu() {
505
- global $menu;
506
-
507
- $position = - 1;
508
- $found_menu = false;
509
-
510
- $menu_slug = $this->get_raw_slug();
511
-
512
- $hook_name = get_plugin_page_hookname( $menu_slug, '' );
513
- foreach ( $menu as $pos => $m ) {
514
- if ( $menu_slug === $m[2] ) {
515
- $position = $pos;
516
- $found_menu = $m;
517
- break;
518
- }
519
- }
520
-
521
- if ( false === $found_menu ) {
522
- return false;
523
- }
524
-
525
- return array(
526
- 'menu' => $found_menu,
527
- 'position' => $position,
528
- 'hook_name' => $hook_name
529
- );
530
- }
531
-
532
- /**
533
- * Find plugin's admin dashboard main submenu item.
534
- *
535
- * @author Vova Feldman (@svovaf)
536
- * @since 1.2.1.6
537
- *
538
- * @return array|false
539
- */
540
- private function find_main_submenu() {
541
- global $submenu;
542
-
543
- $top_level_menu_slug = $this->get_top_level_menu_slug();
544
-
545
- if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
546
- return false;
547
- }
548
-
549
- $submenu_slug = $this->get_raw_slug();
550
-
551
- $position = - 1;
552
- $found_submenu = false;
553
-
554
- $hook_name = get_plugin_page_hookname( $submenu_slug, '' );
555
-
556
- foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
557
- if ( $submenu_slug === $sub[2] ) {
558
- $position = $pos;
559
- $found_submenu = $sub;
560
- }
561
- }
562
-
563
- if ( false === $found_submenu ) {
564
- return false;
565
- }
566
-
567
- return array(
568
- 'menu' => $found_submenu,
569
- 'parent_slug' => $top_level_menu_slug,
570
- 'position' => $position,
571
- 'hook_name' => $hook_name
572
- );
573
- }
574
-
575
- /**
576
- * Remove all sub-menu items.
577
- *
578
- * @author Vova Feldman (@svovaf)
579
- * @since 1.0.7
580
- *
581
- * @return bool If submenu with plugin's menu slug was found.
582
- */
583
- private function remove_all_submenu_items() {
584
- global $submenu;
585
-
586
- $menu_slug = $this->get_raw_slug();
587
-
588
- if ( ! isset( $submenu[ $menu_slug ] ) ) {
589
- return false;
590
- }
591
-
592
- /**
593
- * This method is NOT executed for WordPress.org themes.
594
- * Since we maintain only one version of the SDK we added this small
595
- * hack to avoid the error from Theme Check since it's a false-positive.
596
- *
597
- * @author Vova Feldman (@svovaf)
598
- * @since 1.2.2.7
599
- */
600
- $submenu_ref = &$submenu;
601
- $submenu_ref[ $menu_slug ] = array();
602
-
603
- return true;
604
- }
605
-
606
- /**
607
- *
608
- * @author Vova Feldman (@svovaf)
609
- * @since 1.0.9
610
- *
611
- * @param bool $remove_top_level_menu
612
- *
613
- * @return false|array[string]mixed
614
- */
615
- function remove_menu_item( $remove_top_level_menu = false ) {
616
- $this->_logger->entrance();
617
-
618
- // Find main menu item.
619
- $top_level_menu = $this->find_top_level_menu();
620
-
621
- if ( false === $top_level_menu ) {
622
- return false;
623
- }
624
-
625
- // Remove it with its actions.
626
- remove_all_actions( $top_level_menu['hook_name'] );
627
-
628
- // Remove all submenu items.
629
- $this->remove_all_submenu_items();
630
-
631
- if ( $remove_top_level_menu ) {
632
- global $menu;
633
- unset( $menu[ $top_level_menu['position'] ] );
634
- }
635
-
636
- return $top_level_menu;
637
- }
638
-
639
- /**
640
- * Get module's main admin setting page URL.
641
- *
642
- * @todo This method was only tested for wp.org compliant themes with a submenu item. Need to test for plugins with top level, submenu, and CPT top level, menu items.
643
- *
644
- * @author Vova Feldman (@svovaf)
645
- * @since 1.2.2.7
646
- *
647
- * @return string
648
- */
649
- function main_menu_url() {
650
- $this->_logger->entrance();
651
-
652
- if ( $this->_is_top_level ) {
653
- $menu = $this->find_top_level_menu();
654
- } else {
655
- $menu = $this->find_main_submenu();
656
- }
657
-
658
- $parent_slug = isset( $menu['parent_slug'] ) ?
659
- $menu['parent_slug'] :
660
- 'admin.php';
661
-
662
- return admin_url( $parent_slug . '?page=' . $menu['menu'][2] );
663
- }
664
-
665
- /**
666
- * @author Vova Feldman (@svovaf)
667
- * @since 1.1.4
668
- *
669
- * @param callable $function
670
- *
671
- * @return false|array[string]mixed
672
- */
673
- function override_menu_item( $function ) {
674
- $found_menu = $this->remove_menu_item();
675
-
676
- if ( false === $found_menu ) {
677
- return false;
678
- }
679
-
680
- if ( ! $this->is_top_level() || ! $this->is_cpt() ) {
681
- $menu_slug = plugin_basename( $this->get_slug() );
682
-
683
- $hookname = get_plugin_page_hookname( $menu_slug, '' );
684
-
685
- // Override menu action.
686
- add_action( $hookname, $function );
687
- } else {
688
- global $menu;
689
-
690
- // Remove original CPT menu.
691
- unset( $menu[ $found_menu['position'] ] );
692
-
693
- // Create new top-level menu action.
694
- $hookname = self::add_page(
695
- $found_menu['menu'][3],
696
- $found_menu['menu'][0],
697
- 'manage_options',
698
- $this->get_slug(),
699
- $function,
700
- $found_menu['menu'][6],
701
- $found_menu['position']
702
- );
703
- }
704
-
705
- return $hookname;
706
- }
707
-
708
- /**
709
- * Adds a counter to the module's top level menu item.
710
- *
711
- * @author Vova Feldman (@svovaf)
712
- * @since 1.2.1.5
713
- *
714
- * @param int $counter
715
- * @param string $class
716
- */
717
- function add_counter_to_menu_item( $counter = 1, $class = '' ) {
718
- global $menu, $submenu;
719
-
720
- $mask = '%s <span class="update-plugins %s count-%3$s" aria-hidden="true"><span>%3$s<span class="screen-reader-text">%3$s notifications</span></span></span>';
721
-
722
- /**
723
- * This method is NOT executed for WordPress.org themes.
724
- * Since we maintain only one version of the SDK we added this small
725
- * hack to avoid the error from Theme Check since it's a false-positive.
726
- *
727
- * @author Vova Feldman (@svovaf)
728
- * @since 1.2.2.7
729
- */
730
- $menu_ref = &$menu;
731
- $submenu_ref = &$submenu;
732
-
733
- if ( $this->_is_top_level ) {
734
- // Find main menu item.
735
- $found_menu = $this->find_top_level_menu();
736
-
737
- if ( false !== $found_menu ) {
738
- // Override menu label.
739
- $menu_ref[ $found_menu['position'] ][0] = sprintf(
740
- $mask,
741
- $found_menu['menu'][0],
742
- $class,
743
- $counter
744
- );
745
- }
746
- } else {
747
- $found_submenu = $this->find_main_submenu();
748
-
749
- if ( false !== $found_submenu ) {
750
- // Override menu label.
751
- $submenu_ref[ $found_submenu['parent_slug'] ][ $found_submenu['position'] ][0] = sprintf(
752
- $mask,
753
- $found_submenu['menu'][0],
754
- $class,
755
- $counter
756
- );
757
- }
758
- }
759
- }
760
-
761
- #endregion Top level menu Override
762
-
763
- /**
764
- * Add a top-level menu page.
765
- *
766
- * Note for WordPress.org Theme/Plugin reviewer:
767
- *
768
- * This is a replication of `add_menu_page()` to avoid Theme Check warning.
769
- *
770
- * Why?
771
- * ====
772
- * Freemius is an SDK for plugin and theme developers. Since the core
773
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
774
- * we only develop and maintain one code base.
775
- *
776
- * This method will not run for wp.org themes (only plugins) since theme
777
- * admin settings/options are now only allowed in the customizer.
778
- *
779
- * If you have any questions or need clarifications, please don't hesitate
780
- * pinging me on slack, my username is @svovaf.
781
- *
782
- * @author Vova Feldman (@svovaf)
783
- * @since 1.2.2
784
- *
785
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is
786
- * selected.
787
- * @param string $menu_title The text to be used for the menu.
788
- * @param string $capability The capability required for this menu to be displayed to the user.
789
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
790
- * @param callable|string $function The function to be called to output the content for this page.
791
- * @param string $icon_url The URL to the icon to be used for this menu.
792
- * * Pass a base64-encoded SVG using a data URI, which will be colored to
793
- * match the color scheme. This should begin with
794
- * 'data:image/svg+xml;base64,'.
795
- * * Pass the name of a Dashicons helper class to use a font icon,
796
- * e.g. 'dashicons-chart-pie'.
797
- * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added
798
- * via CSS.
799
- * @param int $position The position in the menu order this one should appear.
800
- *
801
- * @return string The resulting page's hook_suffix.
802
- */
803
- static function add_page(
804
- $page_title,
805
- $menu_title,
806
- $capability,
807
- $menu_slug,
808
- $function = '',
809
- $icon_url = '',
810
- $position = null
811
- ) {
812
- $fn = 'add_menu' . '_page';
813
-
814
- return $fn(
815
- $page_title,
816
- $menu_title,
817
- $capability,
818
- $menu_slug,
819
- $function,
820
- $icon_url,
821
- $position
822
- );
823
- }
824
-
825
- /**
826
- * Add page and update menu instance settings.
827
- *
828
- * @author Vova Feldman (@svovaf)
829
- * @since 2.0.0
830
- *
831
- * @param string $page_title
832
- * @param string $menu_title
833
- * @param string $capability
834
- * @param string $menu_slug
835
- * @param callable|string $function
836
- * @param string $icon_url
837
- * @param int|null $position
838
- *
839
- * @return string
840
- */
841
- function add_page_and_update(
842
- $page_title,
843
- $menu_title,
844
- $capability,
845
- $menu_slug,
846
- $function = '',
847
- $icon_url = '',
848
- $position = null
849
- ) {
850
- $this->_menu_slug = $menu_slug;
851
- $this->_is_top_level = true;
852
- $this->_menu_exists = true;
853
- $this->_network_menu_exists = true;
854
-
855
- return self::add_page(
856
- $page_title,
857
- $menu_title,
858
- $capability,
859
- $menu_slug,
860
- $function,
861
- $icon_url,
862
- $position
863
- );
864
- }
865
-
866
- /**
867
- * Add a submenu page.
868
- *
869
- * Note for WordPress.org Theme/Plugin reviewer:
870
- *
871
- * This is a replication of `add_submenu_page()` to avoid Theme Check warning.
872
- *
873
- * Why?
874
- * ====
875
- * Freemius is an SDK for plugin and theme developers. Since the core
876
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
877
- * we only develop and maintain one code base.
878
- *
879
- * This method will not run for wp.org themes (only plugins) since theme
880
- * admin settings/options are now only allowed in the customizer.
881
- *
882
- * If you have any questions or need clarifications, please don't hesitate
883
- * pinging me on slack, my username is @svovaf.
884
- *
885
- * @author Vova Feldman (@svovaf)
886
- * @since 1.2.2
887
- *
888
- * @param string $parent_slug The slug name for the parent menu (or the file name of a standard
889
- * WordPress admin page).
890
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is
891
- * selected.
892
- * @param string $menu_title The text to be used for the menu.
893
- * @param string $capability The capability required for this menu to be displayed to the user.
894
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
895
- * @param callable|string $function The function to be called to output the content for this page.
896
- *
897
- * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability
898
- * required.
899
- */
900
- static function add_subpage(
901
- $parent_slug,
902
- $page_title,
903
- $menu_title,
904
- $capability,
905
- $menu_slug,
906
- $function = ''
907
- ) {
908
- $fn = 'add_submenu' . '_page';
909
-
910
- return $fn( $parent_slug,
911
- $page_title,
912
- $menu_title,
913
- $capability,
914
- $menu_slug,
915
- $function
916
- );
917
- }
918
-
919
- /**
920
- * Add sub page and update menu instance settings.
921
- *
922
- * @author Vova Feldman (@svovaf)
923
- * @since 2.0.0
924
- *
925
- * @param string $parent_slug
926
- * @param string $page_title
927
- * @param string $menu_title
928
- * @param string $capability
929
- * @param string $menu_slug
930
- * @param callable|string $function
931
- *
932
- * @return string
933
- */
934
- function add_subpage_and_update(
935
- $parent_slug,
936
- $page_title,
937
- $menu_title,
938
- $capability,
939
- $menu_slug,
940
- $function = ''
941
- ) {
942
- $this->_menu_slug = $menu_slug;
943
- $this->_parent_slug = $parent_slug;
944
- $this->_is_top_level = false;
945
- $this->_menu_exists = true;
946
- $this->_network_menu_exists = true;
947
-
948
- return self::add_subpage(
949
- $parent_slug,
950
- $page_title,
951
- $menu_title,
952
- $capability,
953
- $menu_slug,
954
- $function
955
- );
956
- }
 
 
 
 
 
 
 
 
 
 
 
 
957
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Admin_Menu_Manager {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @since 1.2.2
19
+ *
20
+ * @var string
21
+ */
22
+ protected $_module_unique_affix;
23
+
24
+ /**
25
+ * @since 1.2.2
26
+ *
27
+ * @var number
28
+ */
29
+ protected $_module_id;
30
+
31
+ /**
32
+ * @since 1.2.2
33
+ *
34
+ * @var string
35
+ */
36
+ protected $_module_type;
37
+
38
+ /**
39
+ * @since 1.0.6
40
+ *
41
+ * @var string
42
+ */
43
+ private $_menu_slug;
44
+ /**
45
+ * @since 1.1.3
46
+ *
47
+ * @var string
48
+ */
49
+ private $_parent_slug;
50
+ /**
51
+ * @since 1.1.3
52
+ *
53
+ * @var string
54
+ */
55
+ private $_parent_type;
56
+ /**
57
+ * @since 1.1.3
58
+ *
59
+ * @var string
60
+ */
61
+ private $_type;
62
+ /**
63
+ * @since 1.1.3
64
+ *
65
+ * @var bool
66
+ */
67
+ private $_is_top_level;
68
+ /**
69
+ * @since 1.1.3
70
+ *
71
+ * @var bool
72
+ */
73
+ private $_is_override_exact;
74
+ /**
75
+ * @since 1.1.3
76
+ *
77
+ * @var array<string,bool>
78
+ */
79
+ private $_default_submenu_items;
80
+ /**
81
+ * @since 1.1.3
82
+ *
83
+ * @var string
84
+ */
85
+ private $_first_time_path;
86
+ /**
87
+ * @since 1.2.2
88
+ *
89
+ * @var bool
90
+ */
91
+ private $_menu_exists;
92
+ /**
93
+ * @since 2.0.0
94
+ *
95
+ * @var bool
96
+ */
97
+ private $_network_menu_exists;
98
+
99
+ #endregion Properties
100
+
101
+ /**
102
+ * @var FS_Logger
103
+ */
104
+ protected $_logger;
105
+
106
+ #region Singleton
107
+
108
+ /**
109
+ * @var FS_Admin_Menu_Manager[]
110
+ */
111
+ private static $_instances = array();
112
+
113
+ /**
114
+ * @param number $module_id
115
+ * @param string $module_type
116
+ * @param string $module_unique_affix
117
+ *
118
+ * @return FS_Admin_Menu_Manager
119
+ */
120
+ static function instance( $module_id, $module_type, $module_unique_affix ) {
121
+ $key = 'm_' . $module_id;
122
+
123
+ if ( ! isset( self::$_instances[ $key ] ) ) {
124
+ self::$_instances[ $key ] = new FS_Admin_Menu_Manager( $module_id, $module_type, $module_unique_affix );
125
+ }
126
+
127
+ return self::$_instances[ $key ];
128
+ }
129
+
130
+ protected function __construct( $module_id, $module_type, $module_unique_affix ) {
131
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
132
+
133
+ $this->_module_id = $module_id;
134
+ $this->_module_type = $module_type;
135
+ $this->_module_unique_affix = $module_unique_affix;
136
+ }
137
+
138
+ #endregion Singleton
139
+
140
+ #region Helpers
141
+
142
+ private function get_option( &$options, $key, $default = false ) {
143
+ return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
144
+ }
145
+
146
+ private function get_bool_option( &$options, $key, $default = false ) {
147
+ return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
148
+ }
149
+
150
+ #endregion Helpers
151
+
152
+ /**
153
+ * @param array $menu
154
+ * @param bool $is_addon
155
+ */
156
+ function init( $menu, $is_addon = false ) {
157
+ $this->_menu_exists = ( isset( $menu['slug'] ) && ! empty( $menu['slug'] ) );
158
+ $this->_network_menu_exists = ( ! empty( $menu['network'] ) && true === $menu['network'] );
159
+
160
+ $this->_menu_slug = ( $this->_menu_exists ? $menu['slug'] : $this->_module_unique_affix );
161
+
162
+ $this->_default_submenu_items = array();
163
+ // @deprecated
164
+ $this->_type = 'page';
165
+ $this->_is_top_level = true;
166
+ $this->_is_override_exact = false;
167
+ $this->_parent_slug = false;
168
+ // @deprecated
169
+ $this->_parent_type = 'page';
170
+
171
+ if ( isset( $menu ) ) {
172
+ if ( ! $is_addon ) {
173
+ $this->_default_submenu_items = array(
174
+ 'contact' => $this->get_bool_option( $menu, 'contact', true ),
175
+ 'support' => $this->get_bool_option( $menu, 'support', true ),
176
+ 'affiliation' => $this->get_bool_option( $menu, 'affiliation', true ),
177
+ 'account' => $this->get_bool_option( $menu, 'account', true ),
178
+ 'pricing' => $this->get_bool_option( $menu, 'pricing', true ),
179
+ 'addons' => $this->get_bool_option( $menu, 'addons', true ),
180
+ );
181
+
182
+ // @deprecated
183
+ $this->_type = $this->get_option( $menu, 'type', 'page' );
184
+ }
185
+
186
+ $this->_is_override_exact = $this->get_bool_option( $menu, 'override_exact' );
187
+
188
+ if ( isset( $menu['parent'] ) ) {
189
+ $this->_parent_slug = $this->get_option( $menu['parent'], 'slug' );
190
+ // @deprecated
191
+ $this->_parent_type = $this->get_option( $menu['parent'], 'type', 'page' );
192
+
193
+ // If parent's slug is different, then it's NOT a top level menu item.
194
+ $this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
195
+ } else {
196
+ /**
197
+ * If no parent then top level if:
198
+ * - Has custom admin menu ('page')
199
+ * - CPT menu type ('cpt')
200
+ */
201
+ // $this->_is_top_level = in_array( $this->_type, array(
202
+ // 'cpt',
203
+ // 'page'
204
+ // ) );
205
+ }
206
+
207
+ $this->_first_time_path = $this->get_option( $menu, 'first-path', false );
208
+ if ( ! empty( $this->_first_time_path ) && is_string( $this->_first_time_path ) ) {
209
+ $this->_first_time_path = admin_url( $this->_first_time_path, 'admin' );
210
+ }
211
+ }
212
+ }
213
+
214
+ /**
215
+ * Check if top level menu.
216
+ *
217
+ * @author Vova Feldman (@svovaf)
218
+ * @since 1.1.3
219
+ *
220
+ * @return bool False if submenu item.
221
+ */
222
+ function is_top_level() {
223
+ return $this->_is_top_level;
224
+ }
225
+
226
+ /**
227
+ * Check if the page should be override on exact URL match.
228
+ *
229
+ * @author Vova Feldman (@svovaf)
230
+ * @since 1.1.3
231
+ *
232
+ * @return bool False if submenu item.
233
+ */
234
+ function is_override_exact() {
235
+ return $this->_is_override_exact;
236
+ }
237
+
238
+
239
+ /**
240
+ * Get the path of the page the user should be forwarded to after first activation.
241
+ *
242
+ * @author Vova Feldman (@svovaf)
243
+ * @since 1.1.3
244
+ *
245
+ * @return string
246
+ */
247
+ function get_first_time_path() {
248
+ return $this->_first_time_path;
249
+ }
250
+
251
+ /**
252
+ * Check if plugin's menu item is part of a custom top level menu.
253
+ *
254
+ * @author Vova Feldman (@svovaf)
255
+ * @since 1.1.3
256
+ *
257
+ * @return bool
258
+ */
259
+ function has_custom_parent() {
260
+ return ! $this->_is_top_level && is_string( $this->_parent_slug );
261
+ }
262
+
263
+ /**
264
+ * @author Leo Fajardo (@leorw)
265
+ * @since 1.2.2
266
+ *
267
+ * @return bool
268
+ */
269
+ function has_menu() {
270
+ return $this->_menu_exists;
271
+ }
272
+
273
+ /**
274
+ * @author Vova Feldman (@svovaf)
275
+ * @since 2.0.0
276
+ *
277
+ * @return bool
278
+ */
279
+ function has_network_menu() {
280
+ return $this->_network_menu_exists;
281
+ }
282
+
283
+ /**
284
+ * @author Leo Fajardo (@leorw)
285
+ *
286
+ * @param string $menu_slug
287
+ *
288
+ * @since 2.1.3
289
+ */
290
+ function set_slug_and_network_menu_exists_flag($menu_slug ) {
291
+ $this->_menu_slug = $menu_slug;
292
+ $this->_network_menu_exists = false;
293
+ }
294
+
295
+ /**
296
+ * @author Vova Feldman (@svovaf)
297
+ * @since 1.1.3
298
+ *
299
+ * @param string $id
300
+ * @param bool $default
301
+ * @param bool $ignore_menu_existence Since 1.2.2.7 If true, check if the submenu item visible even if there's no parent menu.
302
+ *
303
+ * @return bool
304
+ */
305
+ function is_submenu_item_visible( $id, $default = true, $ignore_menu_existence = false ) {
306
+ if ( ! $ignore_menu_existence && ! $this->has_menu() ) {
307
+ return false;
308
+ }
309
+
310
+ return fs_apply_filter(
311
+ $this->_module_unique_affix,
312
+ 'is_submenu_visible',
313
+ $this->get_bool_option( $this->_default_submenu_items, $id, $default ),
314
+ $id
315
+ );
316
+ }
317
+
318
+ /**
319
+ * Calculates admin settings menu slug.
320
+ * If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
321
+ *
322
+ * @author Vova Feldman (@svovaf)
323
+ * @since 1.1.3
324
+ *
325
+ * @param string $page
326
+ *
327
+ * @return string
328
+ */
329
+ function get_slug( $page = '' ) {
330
+ return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
331
+ $this->_menu_slug :
332
+ $this->_module_unique_affix ) . ( empty( $page ) ? '' : ( '-' . $page ) );
333
+ }
334
+
335
+ /**
336
+ * @author Vova Feldman (@svovaf)
337
+ * @since 1.1.3
338
+ *
339
+ * @return string
340
+ */
341
+ function get_parent_slug() {
342
+ return $this->_parent_slug;
343
+ }
344
+
345
+ /**
346
+ * @author Vova Feldman (@svovaf)
347
+ * @since 1.1.3
348
+ *
349
+ * @return string
350
+ */
351
+ function get_type() {
352
+ return $this->_type;
353
+ }
354
+
355
+ /**
356
+ * @author Vova Feldman (@svovaf)
357
+ * @since 1.1.3
358
+ *
359
+ * @return bool
360
+ */
361
+ function is_cpt() {
362
+ return ( 0 === strpos( $this->_menu_slug, 'edit.php?post_type=' ) ||
363
+ // Back compatibility.
364
+ 'cpt' === $this->_type
365
+ );
366
+ }
367
+
368
+ /**
369
+ * @author Vova Feldman (@svovaf)
370
+ * @since 1.1.3
371
+ *
372
+ * @return string
373
+ */
374
+ function get_parent_type() {
375
+ return $this->_parent_type;
376
+ }
377
+
378
+ /**
379
+ * @author Vova Feldman (@svovaf)
380
+ * @since 1.1.3
381
+ *
382
+ * @return string
383
+ */
384
+ function get_raw_slug() {
385
+ return $this->_menu_slug;
386
+ }
387
+
388
+ /**
389
+ * Get plugin's original menu slug.
390
+ *
391
+ * @author Vova Feldman (@svovaf)
392
+ * @since 1.1.3
393
+ *
394
+ * @return string
395
+ */
396
+ function get_original_menu_slug() {
397
+ if ( 'cpt' === $this->_type ) {
398
+ return add_query_arg( array(
399
+ 'post_type' => $this->_menu_slug
400
+ ), 'edit.php' );
401
+ }
402
+
403
+ if ( false === strpos( $this->_menu_slug, '.php?' ) ) {
404
+ return $this->_menu_slug;
405
+ } else {
406
+ return $this->_module_unique_affix;
407
+ }
408
+ }
409
+
410
+ /**
411
+ * @author Vova Feldman (@svovaf)
412
+ * @since 1.1.3
413
+ *
414
+ * @return string
415
+ */
416
+ function get_top_level_menu_slug() {
417
+ return $this->has_custom_parent() ?
418
+ $this->get_parent_slug() :
419
+ $this->get_raw_slug();
420
+ }
421
+
422
+ /**
423
+ * Is user on plugin's admin activation page.
424
+ *
425
+ * @author Vova Feldman (@svovaf)
426
+ * @since 1.0.8
427
+ *
428
+ * @return bool
429
+ */
430
+ function is_main_settings_page() {
431
+ if ( $this->_menu_exists &&
432
+ ( fs_is_plugin_page( $this->_menu_slug ) || fs_is_plugin_page( $this->_module_unique_affix ) )
433
+ ) {
434
+ /**
435
+ * Module has a settings menu and the context page is the main settings page, so assume it's in
436
+ * activation (doesn't really check if already opted-in/skipped or not).
437
+ *
438
+ * @since 1.2.2
439
+ */
440
+ return true;
441
+ }
442
+
443
+ global $pagenow;
444
+ if ( ( WP_FS__MODULE_TYPE_THEME === $this->_module_type ) && Freemius::is_themes_page() ) {
445
+ /**
446
+ * In activation only when show_optin query string param is given.
447
+ *
448
+ * @since 1.2.2
449
+ */
450
+ return fs_request_get_bool( $this->_module_unique_affix . '_show_optin' );
451
+ }
452
+
453
+ return false;
454
+ }
455
+
456
+ #region Submenu Override
457
+
458
+ /**
459
+ * Override submenu's action.
460
+ *
461
+ * @author Vova Feldman (@svovaf)
462
+ * @since 1.1.0
463
+ *
464
+ * @param string $parent_slug
465
+ * @param string $menu_slug
466
+ * @param callable $function
467
+ *
468
+ * @return false|string If submenu exist, will return the hook name.
469
+ */
470
+ function override_submenu_action( $parent_slug, $menu_slug, $function ) {
471
+ global $submenu;
472
+
473
+ $menu_slug = plugin_basename( $menu_slug );
474
+ $parent_slug = plugin_basename( $parent_slug );
475
+
476
+ if ( ! isset( $submenu[ $parent_slug ] ) ) {
477
+ // Parent menu not exist.
478
+ return false;
479
+ }
480
+
481
+ $found_submenu_item = false;
482
+ foreach ( $submenu[ $parent_slug ] as $submenu_item ) {
483
+ if ( $menu_slug === $submenu_item[2] ) {
484
+ $found_submenu_item = $submenu_item;
485
+ break;
486
+ }
487
+ }
488
+
489
+ if ( false === $found_submenu_item ) {
490
+ // Submenu item not found.
491
+ return false;
492
+ }
493
+
494
+ // Remove current function.
495
+ $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
496
+ remove_all_actions( $hookname );
497
+
498
+ // Attach new action.
499
+ add_action( $hookname, $function );
500
+
501
+ return $hookname;
502
+ }
503
+
504
+ #endregion Submenu Override
505
+
506
+ #region Top level menu Override
507
+
508
+ /**
509
+ * Find plugin's admin dashboard main menu item.
510
+ *
511
+ * @author Vova Feldman (@svovaf)
512
+ * @since 1.0.2
513
+ *
514
+ * @return string[]|false
515
+ */
516
+ private function find_top_level_menu() {
517
+ global $menu;
518
+
519
+ $position = - 1;
520
+ $found_menu = false;
521
+
522
+ $menu_slug = $this->get_raw_slug();
523
+
524
+ $hook_name = get_plugin_page_hookname( $menu_slug, '' );
525
+ foreach ( $menu as $pos => $m ) {
526
+ if ( $menu_slug === $m[2] ) {
527
+ $position = $pos;
528
+ $found_menu = $m;
529
+ break;
530
+ }
531
+ }
532
+
533
+ if ( false === $found_menu ) {
534
+ return false;
535
+ }
536
+
537
+ return array(
538
+ 'menu' => $found_menu,
539
+ 'position' => $position,
540
+ 'hook_name' => $hook_name
541
+ );
542
+ }
543
+
544
+ /**
545
+ * Find plugin's admin dashboard main submenu item.
546
+ *
547
+ * @author Vova Feldman (@svovaf)
548
+ * @since 1.2.1.6
549
+ *
550
+ * @return array|false
551
+ */
552
+ private function find_main_submenu() {
553
+ global $submenu;
554
+
555
+ $top_level_menu_slug = $this->get_top_level_menu_slug();
556
+
557
+ if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
558
+ return false;
559
+ }
560
+
561
+ $submenu_slug = $this->get_raw_slug();
562
+
563
+ $position = - 1;
564
+ $found_submenu = false;
565
+
566
+ $hook_name = get_plugin_page_hookname( $submenu_slug, '' );
567
+
568
+ foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
569
+ if ( $submenu_slug === $sub[2] ) {
570
+ $position = $pos;
571
+ $found_submenu = $sub;
572
+ }
573
+ }
574
+
575
+ if ( false === $found_submenu ) {
576
+ return false;
577
+ }
578
+
579
+ return array(
580
+ 'menu' => $found_submenu,
581
+ 'parent_slug' => $top_level_menu_slug,
582
+ 'position' => $position,
583
+ 'hook_name' => $hook_name
584
+ );
585
+ }
586
+
587
+ /**
588
+ * Remove all sub-menu items.
589
+ *
590
+ * @author Vova Feldman (@svovaf)
591
+ * @since 1.0.7
592
+ *
593
+ * @return bool If submenu with plugin's menu slug was found.
594
+ */
595
+ private function remove_all_submenu_items() {
596
+ global $submenu;
597
+
598
+ $menu_slug = $this->get_raw_slug();
599
+
600
+ if ( ! isset( $submenu[ $menu_slug ] ) ) {
601
+ return false;
602
+ }
603
+
604
+ /**
605
+ * This method is NOT executed for WordPress.org themes.
606
+ * Since we maintain only one version of the SDK we added this small
607
+ * hack to avoid the error from Theme Check since it's a false-positive.
608
+ *
609
+ * @author Vova Feldman (@svovaf)
610
+ * @since 1.2.2.7
611
+ */
612
+ $submenu_ref = &$submenu;
613
+ $submenu_ref[ $menu_slug ] = array();
614
+
615
+ return true;
616
+ }
617
+
618
+ /**
619
+ *
620
+ * @author Vova Feldman (@svovaf)
621
+ * @since 1.0.9
622
+ *
623
+ * @param bool $remove_top_level_menu
624
+ *
625
+ * @return false|array[string]mixed
626
+ */
627
+ function remove_menu_item( $remove_top_level_menu = false ) {
628
+ $this->_logger->entrance();
629
+
630
+ // Find main menu item.
631
+ $top_level_menu = $this->find_top_level_menu();
632
+
633
+ if ( false === $top_level_menu ) {
634
+ return false;
635
+ }
636
+
637
+ // Remove it with its actions.
638
+ remove_all_actions( $top_level_menu['hook_name'] );
639
+
640
+ // Remove all submenu items.
641
+ $this->remove_all_submenu_items();
642
+
643
+ if ( $remove_top_level_menu ) {
644
+ global $menu;
645
+ unset( $menu[ $top_level_menu['position'] ] );
646
+ }
647
+
648
+ return $top_level_menu;
649
+ }
650
+
651
+ /**
652
+ * Get module's main admin setting page URL.
653
+ *
654
+ * @todo This method was only tested for wp.org compliant themes with a submenu item. Need to test for plugins with top level, submenu, and CPT top level, menu items.
655
+ *
656
+ * @author Vova Feldman (@svovaf)
657
+ * @since 1.2.2.7
658
+ *
659
+ * @return string
660
+ */
661
+ function main_menu_url() {
662
+ $this->_logger->entrance();
663
+
664
+ if ( $this->_is_top_level ) {
665
+ $menu = $this->find_top_level_menu();
666
+ } else {
667
+ $menu = $this->find_main_submenu();
668
+ }
669
+
670
+ $parent_slug = isset( $menu['parent_slug'] ) ?
671
+ $menu['parent_slug'] :
672
+ 'admin.php';
673
+
674
+ return admin_url( $parent_slug . '?page=' . $menu['menu'][2] );
675
+ }
676
+
677
+ /**
678
+ * @author Vova Feldman (@svovaf)
679
+ * @since 1.1.4
680
+ *
681
+ * @param callable $function
682
+ *
683
+ * @return false|array[string]mixed
684
+ */
685
+ function override_menu_item( $function ) {
686
+ $found_menu = $this->remove_menu_item();
687
+
688
+ if ( false === $found_menu ) {
689
+ return false;
690
+ }
691
+
692
+ if ( ! $this->is_top_level() || ! $this->is_cpt() ) {
693
+ $menu_slug = plugin_basename( $this->get_slug() );
694
+
695
+ $hookname = get_plugin_page_hookname( $menu_slug, '' );
696
+
697
+ // Override menu action.
698
+ add_action( $hookname, $function );
699
+ } else {
700
+ global $menu;
701
+
702
+ // Remove original CPT menu.
703
+ unset( $menu[ $found_menu['position'] ] );
704
+
705
+ // Create new top-level menu action.
706
+ $hookname = self::add_page(
707
+ $found_menu['menu'][3],
708
+ $found_menu['menu'][0],
709
+ 'manage_options',
710
+ $this->get_slug(),
711
+ $function,
712
+ $found_menu['menu'][6],
713
+ $found_menu['position']
714
+ );
715
+ }
716
+
717
+ return $hookname;
718
+ }
719
+
720
+ /**
721
+ * Adds a counter to the module's top level menu item.
722
+ *
723
+ * @author Vova Feldman (@svovaf)
724
+ * @since 1.2.1.5
725
+ *
726
+ * @param int $counter
727
+ * @param string $class
728
+ */
729
+ function add_counter_to_menu_item( $counter = 1, $class = '' ) {
730
+ global $menu, $submenu;
731
+
732
+ $mask = '%s <span class="update-plugins %s count-%3$s" aria-hidden="true"><span>%3$s<span class="screen-reader-text">%3$s notifications</span></span></span>';
733
+
734
+ /**
735
+ * This method is NOT executed for WordPress.org themes.
736
+ * Since we maintain only one version of the SDK we added this small
737
+ * hack to avoid the error from Theme Check since it's a false-positive.
738
+ *
739
+ * @author Vova Feldman (@svovaf)
740
+ * @since 1.2.2.7
741
+ */
742
+ $menu_ref = &$menu;
743
+ $submenu_ref = &$submenu;
744
+
745
+ if ( $this->_is_top_level ) {
746
+ // Find main menu item.
747
+ $found_menu = $this->find_top_level_menu();
748
+
749
+ if ( false !== $found_menu ) {
750
+ // Override menu label.
751
+ $menu_ref[ $found_menu['position'] ][0] = sprintf(
752
+ $mask,
753
+ $found_menu['menu'][0],
754
+ $class,
755
+ $counter
756
+ );
757
+ }
758
+ } else {
759
+ $found_submenu = $this->find_main_submenu();
760
+
761
+ if ( false !== $found_submenu ) {
762
+ // Override menu label.
763
+ $submenu_ref[ $found_submenu['parent_slug'] ][ $found_submenu['position'] ][0] = sprintf(
764
+ $mask,
765
+ $found_submenu['menu'][0],
766
+ $class,
767
+ $counter
768
+ );
769
+ }
770
+ }
771
+ }
772
+
773
+ #endregion Top level menu Override
774
+
775
+ /**
776
+ * Add a top-level menu page.
777
+ *
778
+ * Note for WordPress.org Theme/Plugin reviewer:
779
+ *
780
+ * This is a replication of `add_menu_page()` to avoid Theme Check warning.
781
+ *
782
+ * Why?
783
+ * ====
784
+ * Freemius is an SDK for plugin and theme developers. Since the core
785
+ * of the SDK is relevant both for plugins and themes, for obvious reasons,
786
+ * we only develop and maintain one code base.
787
+ *
788
+ * This method will not run for wp.org themes (only plugins) since theme
789
+ * admin settings/options are now only allowed in the customizer.
790
+ *
791
+ * If you have any questions or need clarifications, please don't hesitate
792
+ * pinging me on slack, my username is @svovaf.
793
+ *
794
+ * @author Vova Feldman (@svovaf)
795
+ * @since 1.2.2
796
+ *
797
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is
798
+ * selected.
799
+ * @param string $menu_title The text to be used for the menu.
800
+ * @param string $capability The capability required for this menu to be displayed to the user.
801
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
802
+ * @param callable|string $function The function to be called to output the content for this page.
803
+ * @param string $icon_url The URL to the icon to be used for this menu.
804
+ * * Pass a base64-encoded SVG using a data URI, which will be colored to
805
+ * match the color scheme. This should begin with
806
+ * 'data:image/svg+xml;base64,'.
807
+ * * Pass the name of a Dashicons helper class to use a font icon,
808
+ * e.g. 'dashicons-chart-pie'.
809
+ * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added
810
+ * via CSS.
811
+ * @param int $position The position in the menu order this one should appear.
812
+ *
813
+ * @return string The resulting page's hook_suffix.
814
+ */
815
+ static function add_page(
816
+ $page_title,
817
+ $menu_title,
818
+ $capability,
819
+ $menu_slug,
820
+ $function = '',
821
+ $icon_url = '',
822
+ $position = null
823
+ ) {
824
+ $fn = 'add_menu' . '_page';
825
+
826
+ return $fn(
827
+ $page_title,
828
+ $menu_title,
829
+ $capability,
830
+ $menu_slug,
831
+ $function,
832
+ $icon_url,
833
+ $position
834
+ );
835
+ }
836
+
837
+ /**
838
+ * Add page and update menu instance settings.
839
+ *
840
+ * @author Vova Feldman (@svovaf)
841
+ * @since 2.0.0
842
+ *
843
+ * @param string $page_title
844
+ * @param string $menu_title
845
+ * @param string $capability
846
+ * @param string $menu_slug
847
+ * @param callable|string $function
848
+ * @param string $icon_url
849
+ * @param int|null $position
850
+ *
851
+ * @return string
852
+ */
853
+ function add_page_and_update(
854
+ $page_title,
855
+ $menu_title,
856
+ $capability,
857
+ $menu_slug,
858
+ $function = '',
859
+ $icon_url = '',
860
+ $position = null
861
+ ) {
862
+ $this->_menu_slug = $menu_slug;
863
+ $this->_is_top_level = true;
864
+ $this->_menu_exists = true;
865
+ $this->_network_menu_exists = true;
866
+
867
+ return self::add_page(
868
+ $page_title,
869
+ $menu_title,
870
+ $capability,
871
+ $menu_slug,
872
+ $function,
873
+ $icon_url,
874
+ $position
875
+ );
876
+ }
877
+
878
+ /**
879
+ * Add a submenu page.
880
+ *
881
+ * Note for WordPress.org Theme/Plugin reviewer:
882
+ *
883
+ * This is a replication of `add_submenu_page()` to avoid Theme Check warning.
884
+ *
885
+ * Why?
886
+ * ====
887
+ * Freemius is an SDK for plugin and theme developers. Since the core
888
+ * of the SDK is relevant both for plugins and themes, for obvious reasons,
889
+ * we only develop and maintain one code base.
890
+ *
891
+ * This method will not run for wp.org themes (only plugins) since theme
892
+ * admin settings/options are now only allowed in the customizer.
893
+ *
894
+ * If you have any questions or need clarifications, please don't hesitate
895
+ * pinging me on slack, my username is @svovaf.
896
+ *
897
+ * @author Vova Feldman (@svovaf)
898
+ * @since 1.2.2
899
+ *
900
+ * @param string $parent_slug The slug name for the parent menu (or the file name of a standard
901
+ * WordPress admin page).
902
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is
903
+ * selected.
904
+ * @param string $menu_title The text to be used for the menu.
905
+ * @param string $capability The capability required for this menu to be displayed to the user.
906
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
907
+ * @param callable|string $function The function to be called to output the content for this page.
908
+ *
909
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability
910
+ * required.
911
+ */
912
+ static function add_subpage(
913
+ $parent_slug,
914
+ $page_title,
915
+ $menu_title,
916
+ $capability,
917
+ $menu_slug,
918
+ $function = ''
919
+ ) {
920
+ $fn = 'add_submenu' . '_page';
921
+
922
+ return $fn( $parent_slug,
923
+ $page_title,
924
+ $menu_title,
925
+ $capability,
926
+ $menu_slug,
927
+ $function
928
+ );
929
+ }
930
+
931
+ /**
932
+ * Add sub page and update menu instance settings.
933
+ *
934
+ * @author Vova Feldman (@svovaf)
935
+ * @since 2.0.0
936
+ *
937
+ * @param string $parent_slug
938
+ * @param string $page_title
939
+ * @param string $menu_title
940
+ * @param string $capability
941
+ * @param string $menu_slug
942
+ * @param callable|string $function
943
+ *
944
+ * @return string
945
+ */
946
+ function add_subpage_and_update(
947
+ $parent_slug,
948
+ $page_title,
949
+ $menu_title,
950
+ $capability,
951
+ $menu_slug,
952
+ $function = ''
953
+ ) {
954
+ $this->_menu_slug = $menu_slug;
955
+ $this->_parent_slug = $parent_slug;
956
+ $this->_is_top_level = false;
957
+ $this->_menu_exists = true;
958
+ $this->_network_menu_exists = true;
959
+
960
+ return self::add_subpage(
961
+ $parent_slug,
962
+ $page_title,
963
+ $menu_title,
964
+ $capability,
965
+ $menu_slug,
966
+ $function
967
+ );
968
+ }
969
  }
includes/pum-sdk/freemius/includes/managers/class-fs-admin-notice-manager.php CHANGED
@@ -219,6 +219,9 @@
219
  return;
220
  }
221
 
 
 
 
222
  foreach ( $this->_notices as $id => $msg ) {
223
  if ( isset( $msg['wp_user_id'] ) && is_numeric( $msg['wp_user_id'] ) ) {
224
  if ( get_current_user_id() != $msg['wp_user_id'] ) {
@@ -226,6 +229,49 @@
226
  }
227
  }
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  fs_require_template( 'admin-notice.php', $msg );
230
 
231
  if ( $msg['sticky'] ) {
@@ -244,6 +290,34 @@
244
  fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
245
  }
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  /**
248
  * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
249
  *
219
  return;
220
  }
221
 
222
+
223
+ $show_admin_notices = ( ! $this->is_gutenberg_page() );
224
+
225
  foreach ( $this->_notices as $id => $msg ) {
226
  if ( isset( $msg['wp_user_id'] ) && is_numeric( $msg['wp_user_id'] ) ) {
227
  if ( get_current_user_id() != $msg['wp_user_id'] ) {
229
  }
230
  }
231
 
232
+ /**
233
+ * Added a filter to control the visibility of admin notices.
234
+ *
235
+ * Usage example:
236
+ *
237
+ * /**
238
+ * * @param bool $show
239
+ * * @param array $msg {
240
+ * * @var string $message The actual message.
241
+ * * @var string $title An optional message title.
242
+ * * @var string $type The type of the message ('success', 'update', 'warning', 'promotion').
243
+ * * @var string $id The unique identifier of the message.
244
+ * * @var string $manager_id The unique identifier of the notices manager. For plugins it would be the plugin's slug, for themes - `<slug>-theme`.
245
+ * * @var string $plugin The product's title.
246
+ * * @var string $wp_user_id An optional WP user ID that this admin notice is for.
247
+ * * }
248
+ * *
249
+ * * @return bool
250
+ * *\/
251
+ * function my_custom_show_admin_notice( $show, $msg ) {
252
+ * if ('trial_promotion' != $msg['id']) {
253
+ * return false;
254
+ * }
255
+ *
256
+ * return $show;
257
+ * }
258
+ *
259
+ * my_fs()->add_filter( 'show_admin_notice', 'my_custom_show_admin_notice', 10, 2 );
260
+ *
261
+ * @author Vova Feldman
262
+ * @since 2.2.0
263
+ */
264
+ $show_notice = call_user_func_array( 'fs_apply_filter', array(
265
+ $this->_module_unique_affix,
266
+ 'show_admin_notice',
267
+ $show_admin_notices,
268
+ $msg
269
+ ) );
270
+
271
+ if ( true !== $show_notice ) {
272
+ continue;
273
+ }
274
+
275
  fs_require_template( 'admin-notice.php', $msg );
276
 
277
  if ( $msg['sticky'] ) {
290
  fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
291
  }
292
 
293
+ /**
294
+ * Check if the current page is the Gutenberg block editor.
295
+ *
296
+ * @author Vova Feldman (@svovaf)
297
+ * @since 2.2.3
298
+ *
299
+ * @return bool
300
+ */
301
+ function is_gutenberg_page() {
302
+ if ( function_exists( 'is_gutenberg_page' ) &&
303
+ is_gutenberg_page()
304
+ ) {
305
+ // The Gutenberg plugin is on.
306
+ return true;
307
+ }
308
+
309
+ $current_screen = get_current_screen();
310
+
311
+ if ( method_exists( $current_screen, 'is_block_editor' ) &&
312
+ $current_screen->is_block_editor()
313
+ ) {
314
+ // Gutenberg page on 5+.
315
+ return true;
316
+ }
317
+
318
+ return false;
319
+ }
320
+
321
  /**
322
  * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
323
  *
includes/pum-sdk/freemius/includes/managers/class-fs-cache-manager.php CHANGED
@@ -1,326 +1,326 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.6
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Cache_Manager {
14
- /**
15
- * @var FS_Option_Manager
16
- */
17
- private $_options;
18
- /**
19
- * @var FS_Logger
20
- */
21
- private $_logger;
22
-
23
- /**
24
- * @var FS_Cache_Manager[]
25
- */
26
- private static $_MANAGERS = array();
27
-
28
- /**
29
- * @author Vova Feldman (@svovaf)
30
- * @since 1.1.3
31
- *
32
- * @param string $id
33
- */
34
- private function __construct( $id ) {
35
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_cach_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
36
-
37
- $this->_logger->entrance();
38
- $this->_logger->log( 'id = ' . $id );
39
-
40
- $this->_options = FS_Option_Manager::get_manager( $id, true, true );
41
- }
42
-
43
- /**
44
- * @author Vova Feldman (@svovaf)
45
- * @since 1.1.6
46
- *
47
- * @param $id
48
- *
49
- * @return FS_Cache_Manager
50
- */
51
- static function get_manager( $id ) {
52
- $id = strtolower( $id );
53
-
54
- if ( ! isset( self::$_MANAGERS[ $id ] ) ) {
55
- self::$_MANAGERS[ $id ] = new FS_Cache_Manager( $id );
56
- }
57
-
58
- return self::$_MANAGERS[ $id ];
59
- }
60
-
61
- /**
62
- * @author Vova Feldman (@svovaf)
63
- * @since 1.1.6
64
- *
65
- * @return bool
66
- */
67
- function is_empty() {
68
- $this->_logger->entrance();
69
-
70
- return $this->_options->is_empty();
71
- }
72
-
73
- /**
74
- * @author Vova Feldman (@svovaf)
75
- * @since 1.1.6
76
- */
77
- function clear() {
78
- $this->_logger->entrance();
79
-
80
- $this->_options->clear( true );
81
- }
82
-
83
- /**
84
- * Delete cache manager from DB.
85
- *
86
- * @author Vova Feldman (@svovaf)
87
- * @since 1.0.9
88
- */
89
- function delete() {
90
- $this->_options->delete();
91
- }
92
-
93
- /**
94
- * Check if there's a cached item.
95
- *
96
- * @author Vova Feldman (@svovaf)
97
- * @since 1.1.6
98
- *
99
- * @param string $key
100
- *
101
- * @return bool
102
- */
103
- function has( $key ) {
104
- $cache_entry = $this->_options->get_option( $key, false );
105
-
106
- return ( is_object( $cache_entry ) &&
107
- isset( $cache_entry->timestamp ) &&
108
- is_numeric( $cache_entry->timestamp )
109
- );
110
- }
111
-
112
- /**
113
- * Check if there's a valid cached item.
114
- *
115
- * @author Vova Feldman (@svovaf)
116
- * @since 1.1.6
117
- *
118
- * @param string $key
119
- * @param null|int $expiration Since 1.2.2.7
120
- *
121
- * @return bool
122
- */
123
- function has_valid( $key, $expiration = null ) {
124
- $cache_entry = $this->_options->get_option( $key, false );
125
-
126
- $is_valid = ( is_object( $cache_entry ) &&
127
- isset( $cache_entry->timestamp ) &&
128
- is_numeric( $cache_entry->timestamp ) &&
129
- $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
130
- );
131
-
132
- if ( $is_valid &&
133
- is_numeric( $expiration ) &&
134
- isset( $cache_entry->created ) &&
135
- is_numeric( $cache_entry->created ) &&
136
- $cache_entry->created + $expiration < WP_FS__SCRIPT_START_TIME
137
- ) {
138
- /**
139
- * Even if the cache is still valid, since we are checking for validity
140
- * with an explicit expiration period, if the period has past, return
141
- * `false` as if the cache is invalid.
142
- *
143
- * @since 1.2.2.7
144
- */
145
- $is_valid = false;
146
- }
147
-
148
- return $is_valid;
149
- }
150
-
151
- /**
152
- * @author Vova Feldman (@svovaf)
153
- * @since 1.1.6
154
- *
155
- * @param string $key
156
- * @param mixed $default
157
- *
158
- * @return mixed
159
- */
160
- function get( $key, $default = null ) {
161
- $this->_logger->entrance( 'key = ' . $key );
162
-
163
- $cache_entry = $this->_options->get_option( $key, false );
164
-
165
- if ( is_object( $cache_entry ) &&
166
- isset( $cache_entry->timestamp ) &&
167
- is_numeric( $cache_entry->timestamp )
168
- ) {
169
- return $cache_entry->result;
170
- }
171
-
172
- return is_object( $default ) ? clone $default : $default;
173
- }
174
-
175
- /**
176
- * @author Vova Feldman (@svovaf)
177
- * @since 1.1.6
178
- *
179
- * @param string $key
180
- * @param mixed $default
181
- *
182
- * @return mixed
183
- */
184
- function get_valid( $key, $default = null ) {
185
- $this->_logger->entrance( 'key = ' . $key );
186
-
187
- $cache_entry = $this->_options->get_option( $key, false );
188
-
189
- if ( is_object( $cache_entry ) &&
190
- isset( $cache_entry->timestamp ) &&
191
- is_numeric( $cache_entry->timestamp ) &&
192
- $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
193
- ) {
194
- return $cache_entry->result;
195
- }
196
-
197
- return is_object( $default ) ? clone $default : $default;
198
- }
199
-
200
- /**
201
- * @author Vova Feldman (@svovaf)
202
- * @since 1.1.6
203
- *
204
- * @param string $key
205
- * @param mixed $value
206
- * @param int $expiration
207
- * @param int $created Since 2.0.0 Cache creation date.
208
- */
209
- function set( $key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $created = WP_FS__SCRIPT_START_TIME ) {
210
- $this->_logger->entrance( 'key = ' . $key );
211
-
212
- $cache_entry = new stdClass();
213
-
214
- $cache_entry->result = $value;
215
- $cache_entry->created = $created;
216
- $cache_entry->timestamp = $created + $expiration;
217
- $this->_options->set_option( $key, $cache_entry, true );
218
- }
219
-
220
- /**
221
- * Get cached record expiration, or false if not cached or expired.
222
- *
223
- * @author Vova Feldman (@svovaf)
224
- * @since 1.1.7.3
225
- *
226
- * @param string $key
227
- *
228
- * @return bool|int
229
- */
230
- function get_record_expiration( $key ) {
231
- $this->_logger->entrance( 'key = ' . $key );
232
-
233
- $cache_entry = $this->_options->get_option( $key, false );
234
-
235
- if ( is_object( $cache_entry ) &&
236
- isset( $cache_entry->timestamp ) &&
237
- is_numeric( $cache_entry->timestamp ) &&
238
- $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
239
- ) {
240
- return $cache_entry->timestamp;
241
- }
242
-
243
- return false;
244
- }
245
-
246
- /**
247
- * Purge cached item.
248
- *
249
- * @author Vova Feldman (@svovaf)
250
- * @since 1.1.6
251
- *
252
- * @param string $key
253
- */
254
- function purge( $key ) {
255
- $this->_logger->entrance( 'key = ' . $key );
256
-
257
- $this->_options->unset_option( $key, true );
258
- }
259
-
260
- /**
261
- * Extend cached item caching period.
262
- *
263
- * @author Vova Feldman (@svovaf)
264
- * @since 2.0.0
265
- *
266
- * @param string $key
267
- * @param int $expiration
268
- *
269
- * @return bool
270
- */
271
- function update_expiration( $key, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
272
- $this->_logger->entrance( 'key = ' . $key );
273
-
274
- $cache_entry = $this->_options->get_option( $key, false );
275
-
276
- if ( ! is_object( $cache_entry ) ||
277
- ! isset( $cache_entry->timestamp ) ||
278
- ! is_numeric( $cache_entry->timestamp )
279
- ) {
280
- return false;
281
- }
282
-
283
- $this->set( $key, $cache_entry->result, $expiration, $cache_entry->created );
284
-
285
- return true;
286
- }
287
-
288
- /**
289
- * Set cached item as expired.
290
- *
291
- * @author Vova Feldman (@svovaf)
292
- * @since 1.2.2.7
293
- *
294
- * @param string $key
295
- */
296
- function expire( $key ) {
297
- $this->_logger->entrance( 'key = ' . $key );
298
-
299
- $cache_entry = $this->_options->get_option( $key, false );
300
-
301
- if ( is_object( $cache_entry ) &&
302
- isset( $cache_entry->timestamp ) &&
303
- is_numeric( $cache_entry->timestamp )
304
- ) {
305
- // Set to expired.
306
- $cache_entry->timestamp = WP_FS__SCRIPT_START_TIME;
307
- $this->_options->set_option( $key, $cache_entry, true );
308
- }
309
- }
310
-
311
- #--------------------------------------------------------------------------------
312
- #region Migration
313
- #--------------------------------------------------------------------------------
314
-
315
- /**
316
- * Migrate options from site level.
317
- *
318
- * @author Vova Feldman (@svovaf)
319
- * @since 2.0.0
320
- */
321
- function migrate_to_network() {
322
- $this->_options->migrate_to_network();
323
- }
324
-
325
- #endregion
326
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.6
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Cache_Manager {
14
+ /**
15
+ * @var FS_Option_Manager
16
+ */
17
+ private $_options;
18
+ /**
19
+ * @var FS_Logger
20
+ */
21
+ private $_logger;
22
+
23
+ /**
24
+ * @var FS_Cache_Manager[]
25
+ */
26
+ private static $_MANAGERS = array();
27
+
28
+ /**
29
+ * @author Vova Feldman (@svovaf)
30
+ * @since 1.1.3
31
+ *
32
+ * @param string $id
33
+ */
34
+ private function __construct( $id ) {
35
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_cach_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
36
+
37
+ $this->_logger->entrance();
38
+ $this->_logger->log( 'id = ' . $id );
39
+
40
+ $this->_options = FS_Option_Manager::get_manager( $id, true, true );
41
+ }
42
+
43
+ /**
44
+ * @author Vova Feldman (@svovaf)
45
+ * @since 1.1.6
46
+ *
47
+ * @param $id
48
+ *
49
+ * @return FS_Cache_Manager
50
+ */
51
+ static function get_manager( $id ) {
52
+ $id = strtolower( $id );
53
+
54
+ if ( ! isset( self::$_MANAGERS[ $id ] ) ) {
55
+ self::$_MANAGERS[ $id ] = new FS_Cache_Manager( $id );
56
+ }
57
+
58
+ return self::$_MANAGERS[ $id ];
59
+ }
60
+
61
+ /**
62
+ * @author Vova Feldman (@svovaf)
63
+ * @since 1.1.6
64
+ *
65
+ * @return bool
66
+ */
67
+ function is_empty() {
68
+ $this->_logger->entrance();
69
+
70
+ return $this->_options->is_empty();
71
+ }
72
+
73
+ /**
74
+ * @author Vova Feldman (@svovaf)
75
+ * @since 1.1.6
76
+ */
77
+ function clear() {
78
+ $this->_logger->entrance();
79
+
80
+ $this->_options->clear( true );
81
+ }
82
+
83
+ /**
84
+ * Delete cache manager from DB.
85
+ *
86
+ * @author Vova Feldman (@svovaf)
87
+ * @since 1.0.9
88
+ */
89
+ function delete() {
90
+ $this->_options->delete();
91
+ }
92
+
93
+ /**
94
+ * Check if there's a cached item.
95
+ *
96
+ * @author Vova Feldman (@svovaf)
97
+ * @since 1.1.6
98
+ *
99
+ * @param string $key
100
+ *
101
+ * @return bool
102
+ */
103
+ function has( $key ) {
104
+ $cache_entry = $this->_options->get_option( $key, false );
105
+
106
+ return ( is_object( $cache_entry ) &&
107
+ isset( $cache_entry->timestamp ) &&
108
+ is_numeric( $cache_entry->timestamp )
109
+ );
110
+ }
111
+
112
+ /**
113
+ * Check if there's a valid cached item.
114
+ *
115
+ * @author Vova Feldman (@svovaf)
116
+ * @since 1.1.6
117
+ *
118
+ * @param string $key
119
+ * @param null|int $expiration Since 1.2.2.7
120
+ *
121
+ * @return bool
122
+ */
123
+ function has_valid( $key, $expiration = null ) {
124
+ $cache_entry = $this->_options->get_option( $key, false );
125
+
126
+ $is_valid = ( is_object( $cache_entry ) &&
127
+ isset( $cache_entry->timestamp ) &&
128
+ is_numeric( $cache_entry->timestamp ) &&
129
+ $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
130
+ );
131
+
132
+ if ( $is_valid &&
133
+ is_numeric( $expiration ) &&
134
+ isset( $cache_entry->created ) &&
135
+ is_numeric( $cache_entry->created ) &&
136
+ $cache_entry->created + $expiration < WP_FS__SCRIPT_START_TIME
137
+ ) {
138
+ /**
139
+ * Even if the cache is still valid, since we are checking for validity
140
+ * with an explicit expiration period, if the period has past, return
141
+ * `false` as if the cache is invalid.
142
+ *
143
+ * @since 1.2.2.7
144
+ */
145
+ $is_valid = false;
146
+ }
147
+
148
+ return $is_valid;
149
+ }
150
+
151
+ /**
152
+ * @author Vova Feldman (@svovaf)
153
+ * @since 1.1.6
154
+ *
155
+ * @param string $key
156
+ * @param mixed $default
157
+ *
158
+ * @return mixed
159
+ */
160
+ function get( $key, $default = null ) {
161
+ $this->_logger->entrance( 'key = ' . $key );
162
+
163
+ $cache_entry = $this->_options->get_option( $key, false );
164
+
165
+ if ( is_object( $cache_entry ) &&
166
+ isset( $cache_entry->timestamp ) &&
167
+ is_numeric( $cache_entry->timestamp )
168
+ ) {
169
+ return $cache_entry->result;
170
+ }
171
+
172
+ return is_object( $default ) ? clone $default : $default;
173
+ }
174
+
175
+ /**
176
+ * @author Vova Feldman (@svovaf)
177
+ * @since 1.1.6
178
+ *
179
+ * @param string $key
180
+ * @param mixed $default
181
+ *
182
+ * @return mixed
183
+ */
184
+ function get_valid( $key, $default = null ) {
185
+ $this->_logger->entrance( 'key = ' . $key );
186
+
187
+ $cache_entry = $this->_options->get_option( $key, false );
188
+
189
+ if ( is_object( $cache_entry ) &&
190
+ isset( $cache_entry->timestamp ) &&
191
+ is_numeric( $cache_entry->timestamp ) &&
192
+ $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
193
+ ) {
194
+ return $cache_entry->result;
195
+ }
196
+
197
+ return is_object( $default ) ? clone $default : $default;
198
+ }
199
+
200
+ /**
201
+ * @author Vova Feldman (@svovaf)
202
+ * @since 1.1.6
203
+ *
204
+ * @param string $key
205
+ * @param mixed $value
206
+ * @param int $expiration
207
+ * @param int $created Since 2.0.0 Cache creation date.
208
+ */
209
+ function set( $key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $created = WP_FS__SCRIPT_START_TIME ) {
210
+ $this->_logger->entrance( 'key = ' . $key );
211
+
212
+ $cache_entry = new stdClass();
213
+
214
+ $cache_entry->result = $value;
215
+ $cache_entry->created = $created;
216
+ $cache_entry->timestamp = $created + $expiration;
217
+ $this->_options->set_option( $key, $cache_entry, true );
218
+ }
219
+
220
+ /**
221
+ * Get cached record expiration, or false if not cached or expired.
222
+ *
223
+ * @author Vova Feldman (@svovaf)
224
+ * @since 1.1.7.3
225
+ *
226
+ * @param string $key
227
+ *
228
+ * @return bool|int
229
+ */
230
+ function get_record_expiration( $key ) {
231
+ $this->_logger->entrance( 'key = ' . $key );
232
+
233
+ $cache_entry = $this->_options->get_option( $key, false );
234
+
235
+ if ( is_object( $cache_entry ) &&
236
+ isset( $cache_entry->timestamp ) &&
237
+ is_numeric( $cache_entry->timestamp ) &&
238
+ $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
239
+ ) {
240
+ return $cache_entry->timestamp;
241
+ }
242
+
243
+ return false;
244
+ }
245
+
246
+ /**
247
+ * Purge cached item.
248
+ *
249
+ * @author Vova Feldman (@svovaf)
250
+ * @since 1.1.6
251
+ *
252
+ * @param string $key
253
+ */
254
+ function purge( $key ) {
255
+ $this->_logger->entrance( 'key = ' . $key );
256
+
257
+ $this->_options->unset_option( $key, true );
258
+ }
259
+
260
+ /**
261
+ * Extend cached item caching period.
262
+ *
263
+ * @author Vova Feldman (@svovaf)
264
+ * @since 2.0.0
265
+ *
266
+ * @param string $key
267
+ * @param int $expiration
268
+ *
269
+ * @return bool
270
+ */
271
+ function update_expiration( $key, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
272
+ $this->_logger->entrance( 'key = ' . $key );
273
+
274
+ $cache_entry = $this->_options->get_option( $key, false );
275
+
276
+ if ( ! is_object( $cache_entry ) ||
277
+ ! isset( $cache_entry->timestamp ) ||
278
+ ! is_numeric( $cache_entry->timestamp )
279
+ ) {
280
+ return false;
281
+ }
282
+
283
+ $this->set( $key, $cache_entry->result, $expiration, $cache_entry->created );
284
+
285
+ return true;
286
+ }
287
+
288
+ /**
289
+ * Set cached item as expired.
290
+ *
291
+ * @author Vova Feldman (@svovaf)
292
+ * @since 1.2.2.7
293
+ *
294
+ * @param string $key
295
+ */
296
+ function expire( $key ) {
297
+ $this->_logger->entrance( 'key = ' . $key );
298
+
299
+ $cache_entry = $this->_options->get_option( $key, false );
300
+
301
+ if ( is_object( $cache_entry ) &&
302
+ isset( $cache_entry->timestamp ) &&
303
+ is_numeric( $cache_entry->timestamp )
304
+ ) {
305
+ // Set to expired.
306
+ $cache_entry->timestamp = WP_FS__SCRIPT_START_TIME;
307
+ $this->_options->set_option( $key, $cache_entry, true );
308
+ }
309
+ }
310
+
311
+ #--------------------------------------------------------------------------------
312
+ #region Migration
313
+ #--------------------------------------------------------------------------------
314
+
315
+ /**
316
+ * Migrate options from site level.
317
+ *
318
+ * @author Vova Feldman (@svovaf)
319
+ * @since 2.0.0
320
+ */
321
+ function migrate_to_network() {
322
+ $this->_options->migrate_to_network();
323
+ }
324
+
325
+ #endregion
326
  }
includes/pum-sdk/freemius/includes/managers/class-fs-gdpr-manager.php CHANGED
@@ -1,202 +1,202 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 2.1.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_GDPR_Manager {
14
- /**
15
- * @var FS_Option_Manager
16
- */
17
- private $_storage;
18
- /**
19
- * @var array {
20
- * @type bool $required Are GDPR rules apply on the current context admin.
21
- * @type bool $show_opt_in_notice Should the marketing and offers opt-in message be shown to the admin or not. If not set, defaults to `true`.
22
- * @type int $notice_shown_at Last time the special GDPR opt-in message was shown to the current admin.
23
- * }
24
- */
25
- private $_data;
26
- /**
27
- * @var int
28
- */
29
- private $_wp_user_id;
30
- /**
31
- * @var string
32
- */
33
- private $_option_name;
34
- /**
35
- * @var FS_Admin_Notices
36
- */
37
- private $_notices;
38
-
39
- #--------------------------------------------------------------------------------
40
- #region Singleton
41
- #--------------------------------------------------------------------------------
42
-
43
- /**
44
- * @var FS_GDPR_Manager
45
- */
46
- private static $_instance;
47
-
48
- /**
49
- * @return FS_GDPR_Manager
50
- */
51
- public static function instance() {
52
- if ( ! isset( self::$_instance ) ) {
53
- self::$_instance = new self();
54
- }
55
-
56
- return self::$_instance;
57
- }
58
-
59
- #endregion
60
-
61
- private function __construct() {
62
- $this->_storage = FS_Option_Manager::get_manager( WP_FS__GDPR_OPTION_NAME, true, true );
63
- $this->_wp_user_id = Freemius::get_current_wp_user_id();
64
- $this->_option_name = "u{$this->_wp_user_id}";
65
- $this->_data = $this->_storage->get_option( $this->_option_name, array() );
66
- $this->_notices = FS_Admin_Notices::instance( 'all_admins', '', '', true );
67
-
68
- if ( ! is_array( $this->_data ) ) {
69
- $this->_data = array();
70
- }
71
- }
72
-
73
- /**
74
- * Update a GDPR option for the current admin and store it.
75
- *
76
- * @author Vova Feldman (@svovaf)
77
- * @since 2.1.0
78
- *
79
- * @param string $name
80
- * @param mixed $value
81
- */
82
- private function update_option( $name, $value ) {
83
- $this->_data[ $name ] = $value;
84
-
85
- $this->_storage->set_option( $this->_option_name, $this->_data, true );
86
- }
87
-
88
- /**
89
- * @author Leo Fajardo (@leorw)
90
- * @since 2.1.0
91
- *
92
- * @return bool|null
93
- */
94
- public function is_required() {
95
- return isset( $this->_data['required'] ) ?
96
- $this->_data['required'] :
97
- null;
98
- }
99
-
100
- /**
101
- * @author Leo Fajardo (@leorw)
102
- * @since 2.1.0
103
- *
104
- * @param bool $is_required
105
- */
106
- public function store_is_required( $is_required ) {
107
- $this->update_option( 'required', $is_required );
108
- }
109
-
110
- /**
111
- * Checks if the GDPR opt-in sticky notice is currently shown.
112
- *
113
- * @author Vova Feldman (@svovaf)
114
- * @since 2.1.0
115
- *
116
- * @return bool
117
- */
118
- public function is_opt_in_notice_shown() {
119
- return $this->_notices->has_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
120
- }
121
-
122
- /**
123
- * Remove the GDPR opt-in sticky notice.
124
- *
125
- * @author Vova Feldman (@svovaf)
126
- * @since 2.1.0
127
- */
128
- public function remove_opt_in_notice() {
129
- $this->_notices->remove_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
130
-
131
- $this->disable_opt_in_notice();
132
- }
133
-
134
- /**
135
- * Prevents the opt-in message from being added/shown.
136
- *
137
- * @author Leo Fajardo (@leorw)
138
- * @since 2.1.0
139
- */
140
- public function disable_opt_in_notice() {
141
- $this->update_option( 'show_opt_in_notice', false );
142
- }
143
-
144
- /**
145
- * Checks if a GDPR opt-in message needs to be shown to the current admin.
146
- *
147
- * @author Vova Feldman (@svovaf)
148
- * @since 2.1.0
149
- *
150
- * @return bool
151
- */
152
- public function should_show_opt_in_notice() {
153
- return (
154
- ! isset( $this->_data['show_opt_in_notice'] ) ||
155
- true === $this->_data['show_opt_in_notice']
156
- );
157
- }
158
-
159
- /**
160
- * Get the last time the GDPR opt-in notice was shown.
161
- *
162
- * @author Vova Feldman (@svovaf)
163
- * @since 2.1.0
164
- *
165
- * @return false|int
166
- */
167
- public function last_time_notice_was_shown() {
168
- return isset( $this->_data['notice_shown_at'] ) ?
169
- $this->_data['notice_shown_at'] :
170
- false;
171
- }
172
-
173
- /**
174
- * Update the timestamp of the last time the GDPR opt-in message was shown to now.
175
- *
176
- * @author Vova Feldman (@svovaf)
177
- * @since 2.1.0
178
- */
179
- public function notice_was_just_shown() {
180
- $this->update_option( 'notice_shown_at', WP_FS__SCRIPT_START_TIME );
181
- }
182
-
183
- /**
184
- * @param string $message
185
- * @param string|null $plugin_title
186
- *
187
- * @author Vova Feldman (@svovaf)
188
- * @since 2.1.0
189
- */
190
- public function add_opt_in_sticky_notice( $message, $plugin_title = null ) {
191
- $this->_notices->add_sticky(
192
- $message,
193
- "gdpr_optin_actions_{$this->_wp_user_id}",
194
- '',
195
- 'promotion',
196
- true,
197
- $this->_wp_user_id,
198
- $plugin_title,
199
- true
200
- );
201
- }
202
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 2.1.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_GDPR_Manager {
14
+ /**
15
+ * @var FS_Option_Manager
16
+ */
17
+ private $_storage;
18
+ /**
19
+ * @var array {
20
+ * @type bool $required Are GDPR rules apply on the current context admin.
21
+ * @type bool $show_opt_in_notice Should the marketing and offers opt-in message be shown to the admin or not. If not set, defaults to `true`.
22
+ * @type int $notice_shown_at Last time the special GDPR opt-in message was shown to the current admin.
23
+ * }
24
+ */
25
+ private $_data;
26
+ /**
27
+ * @var int
28
+ */
29
+ private $_wp_user_id;
30
+ /**
31
+ * @var string
32
+ */
33
+ private $_option_name;
34
+ /**
35
+ * @var FS_Admin_Notices
36
+ */
37
+ private $_notices;
38
+
39
+ #--------------------------------------------------------------------------------
40
+ #region Singleton
41
+ #--------------------------------------------------------------------------------
42
+
43
+ /**
44
+ * @var FS_GDPR_Manager
45
+ */
46
+ private static $_instance;
47
+
48
+ /**
49
+ * @return FS_GDPR_Manager
50
+ */
51
+ public static function instance() {
52
+ if ( ! isset( self::$_instance ) ) {
53
+ self::$_instance = new self();
54
+ }
55
+
56
+ return self::$_instance;
57
+ }
58
+
59
+ #endregion
60
+
61
+ private function __construct() {
62
+ $this->_storage = FS_Option_Manager::get_manager( WP_FS__GDPR_OPTION_NAME, true, true );
63
+ $this->_wp_user_id = Freemius::get_current_wp_user_id();
64
+ $this->_option_name = "u{$this->_wp_user_id}";
65
+ $this->_data = $this->_storage->get_option( $this->_option_name, array() );
66
+ $this->_notices = FS_Admin_Notices::instance( 'all_admins', '', '', true );
67
+
68
+ if ( ! is_array( $this->_data ) ) {
69
+ $this->_data = array();
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Update a GDPR option for the current admin and store it.
75
+ *
76
+ * @author Vova Feldman (@svovaf)
77
+ * @since 2.1.0
78
+ *
79
+ * @param string $name
80
+ * @param mixed $value
81
+ */
82
+ private function update_option( $name, $value ) {
83
+ $this->_data[ $name ] = $value;
84
+
85
+ $this->_storage->set_option( $this->_option_name, $this->_data, true );
86
+ }
87
+
88
+ /**
89
+ * @author Leo Fajardo (@leorw)
90
+ * @since 2.1.0
91
+ *
92
+ * @return bool|null
93
+ */
94
+ public function is_required() {
95
+ return isset( $this->_data['required'] ) ?
96
+ $this->_data['required'] :
97
+ null;
98
+ }
99
+
100
+ /**
101
+ * @author Leo Fajardo (@leorw)
102
+ * @since 2.1.0
103
+ *
104
+ * @param bool $is_required
105
+ */
106
+ public function store_is_required( $is_required ) {
107
+ $this->update_option( 'required', $is_required );
108
+ }
109
+
110
+ /**
111
+ * Checks if the GDPR opt-in sticky notice is currently shown.
112
+ *
113
+ * @author Vova Feldman (@svovaf)
114
+ * @since 2.1.0
115
+ *
116
+ * @return bool
117
+ */
118
+ public function is_opt_in_notice_shown() {
119
+ return $this->_notices->has_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
120
+ }
121
+
122
+ /**
123
+ * Remove the GDPR opt-in sticky notice.
124
+ *
125
+ * @author Vova Feldman (@svovaf)
126
+ * @since 2.1.0
127
+ */
128
+ public function remove_opt_in_notice() {
129
+ $this->_notices->remove_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
130
+
131
+ $this->disable_opt_in_notice();
132
+ }
133
+
134
+ /**
135
+ * Prevents the opt-in message from being added/shown.
136
+ *
137
+ * @author Leo Fajardo (@leorw)
138
+ * @since 2.1.0
139
+ */
140
+ public function disable_opt_in_notice() {
141
+ $this->update_option( 'show_opt_in_notice', false );
142
+ }
143
+
144
+ /**
145
+ * Checks if a GDPR opt-in message needs to be shown to the current admin.
146
+ *
147
+ * @author Vova Feldman (@svovaf)
148
+ * @since 2.1.0
149
+ *
150
+ * @return bool
151
+ */
152
+ public function should_show_opt_in_notice() {
153
+ return (
154
+ ! isset( $this->_data['show_opt_in_notice'] ) ||
155
+ true === $this->_data['show_opt_in_notice']
156
+ );
157
+ }
158
+
159
+ /**
160
+ * Get the last time the GDPR opt-in notice was shown.
161
+ *
162
+ * @author Vova Feldman (@svovaf)
163
+ * @since 2.1.0
164
+ *
165
+ * @return false|int
166
+ */
167
+ public function last_time_notice_was_shown() {
168
+ return isset( $this->_data['notice_shown_at'] ) ?
169
+ $this->_data['notice_shown_at'] :
170
+ false;
171
+ }
172
+
173
+ /**
174
+ * Update the timestamp of the last time the GDPR opt-in message was shown to now.
175
+ *
176
+ * @author Vova Feldman (@svovaf)
177
+ * @since 2.1.0
178
+ */
179
+ public function notice_was_just_shown() {
180
+ $this->update_option( 'notice_shown_at', WP_FS__SCRIPT_START_TIME );
181
+ }
182
+
183
+ /**
184
+ * @param string $message
185
+ * @param string|null $plugin_title
186
+ *
187
+ * @author Vova Feldman (@svovaf)
188
+ * @since 2.1.0
189
+ */
190
+ public function add_opt_in_sticky_notice( $message, $plugin_title = null ) {
191
+ $this->_notices->add_sticky(
192
+ $message,
193
+ "gdpr_optin_actions_{$this->_wp_user_id}",
194
+ '',
195
+ 'promotion',
196
+ true,
197
+ $this->_wp_user_id,
198
+ $plugin_title,
199
+ true
200
+ );
201
+ }
202
  }
includes/pum-sdk/freemius/includes/managers/class-fs-key-value-storage.php CHANGED
@@ -1,392 +1,392 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Key_Value_Storage
15
- *
16
- * @property int $install_timestamp
17
- * @property int $activation_timestamp
18
- * @property int $sync_timestamp
19
- * @property object $sync_cron
20
- * @property int $install_sync_timestamp
21
- * @property array $connectivity_test
22
- * @property array $is_on
23
- * @property object $trial_plan
24
- * @property bool $has_trial_plan
25
- * @property bool $trial_promotion_shown
26
- * @property string $sdk_version
27
- * @property string $sdk_last_version
28
- * @property bool $sdk_upgrade_mode
29
- * @property bool $sdk_downgrade_mode
30
- * @property bool $plugin_upgrade_mode
31
- * @property bool $plugin_downgrade_mode
32
- * @property string $plugin_version
33
- * @property string $plugin_last_version
34
- * @property bool $is_plugin_new_install
35
- * @property bool $was_plugin_loaded
36
- * @property object $plugin_main_file
37
- * @property bool $prev_is_premium
38
- * @property array $is_anonymous
39
- * @property bool $is_pending_activation
40
- * @property bool $sticky_optin_added
41
- * @property object $uninstall_reason
42
- * @property object $subscription
43
- */
44
- class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
45
- /**
46
- * @var string
47
- */
48
- protected $_id;
49
-
50
- /**
51
- * @since 1.2.2
52
- *
53
- * @var string
54
- */
55
- protected $_secondary_id;
56
-
57
- /**
58
- * @since 2.0.0
59
- * @var int The ID of the blog that is associated with the current site level options.
60
- */
61
- private $_blog_id = 0;
62
-
63
- /**
64
- * @since 2.0.0
65
- * @var bool
66
- */
67
- private $_is_multisite_storage;
68
-
69
- /**
70
- * @var array
71
- */
72
- protected $_data;
73
-
74
- /**
75
- * @var FS_Key_Value_Storage[]
76
- */
77
- private static $_instances = array();
78
-
79
- /**
80
- * @var FS_Logger
81
- */
82
- protected $_logger;
83
-
84
- /**
85
- * @param string $id
86
- * @param string $secondary_id
87
- * @param bool $network_level_or_blog_id
88
- *
89
- * @return FS_Key_Value_Storage
90
- */
91
- static function instance( $id, $secondary_id, $network_level_or_blog_id = false ) {
92
- $key = $id . ':' . $secondary_id;
93
-
94
- if ( is_multisite() ) {
95
- if ( true === $network_level_or_blog_id ) {
96
- $key .= ':ms';
97
- } else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
98
- $key .= ":{$network_level_or_blog_id}";
99
- } else {
100
- $network_level_or_blog_id = get_current_blog_id();
101
-
102
- $key .= ":{$network_level_or_blog_id}";
103
- }
104
- }
105
-
106
- if ( ! isset( self::$_instances[ $key ] ) ) {
107
- self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id, $network_level_or_blog_id );
108
- }
109
-
110
- return self::$_instances[ $key ];
111
- }
112
-
113
- protected function __construct( $id, $secondary_id, $network_level_or_blog_id = false ) {
114
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
115
-
116
- $this->_id = $id;
117
- $this->_secondary_id = $secondary_id;
118
-
119
- if ( is_multisite() ) {
120
- $this->_is_multisite_storage = ( true === $network_level_or_blog_id );
121
-
122
- if ( is_numeric( $network_level_or_blog_id ) ) {
123
- $this->_blog_id = $network_level_or_blog_id;
124
- }
125
- } else {
126
- $this->_is_multisite_storage = false;
127
- }
128
-
129
- $this->load();
130
- }
131
-
132
- protected function get_option_manager() {
133
- return FS_Option_Manager::get_manager(
134
- WP_FS__ACCOUNTS_OPTION_NAME,
135
- true,
136
- $this->_is_multisite_storage ?
137
- true :
138
- ( $this->_blog_id > 0 ? $this->_blog_id : false )
139
- );
140
- }
141
-
142
- protected function get_all_data() {
143
- return $this->get_option_manager()->get_option( $this->_id, array() );
144
- }
145
-
146
- /**
147
- * Load plugin data from local DB.
148
- *
149
- * @author Vova Feldman (@svovaf)
150
- * @since 1.0.7
151
- */
152
- function load() {
153
- $all_plugins_data = $this->get_all_data();
154
- $this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
155
- $all_plugins_data[ $this->_secondary_id ] :
156
- array();
157
- }
158
-
159
- /**
160
- * @author Vova Feldman (@svovaf)
161
- * @since 1.0.7
162
- *
163
- * @param string $key
164
- * @param mixed $value
165
- * @param bool $flush
166
- */
167
- function store( $key, $value, $flush = true ) {
168
- if ( $this->_logger->is_on() ) {
169
- $this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
170
- }
171
-
172
- if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
173
- // No need to store data if the value wasn't changed.
174
- return;
175
- }
176
-
177
- $all_data = $this->get_all_data();
178
-
179
- $this->_data[ $key ] = $value;
180
-
181
- $all_data[ $this->_secondary_id ] = $this->_data;
182
-
183
- $options_manager = $this->get_option_manager();
184
- $options_manager->set_option( $this->_id, $all_data, $flush );
185
- }
186
-
187
- /**
188
- * @author Vova Feldman (@svovaf)
189
- * @since 2.0.0
190
- */
191
- function save() {
192
- $this->get_option_manager()->store();
193
- }
194
-
195
- /**
196
- * @author Vova Feldman (@svovaf)
197
- * @since 1.0.7
198
- *
199
- * @param bool $store
200
- * @param string[] $exceptions Set of keys to keep and not clear.
201
- */
202
- function clear_all( $store = true, $exceptions = array() ) {
203
- $new_data = array();
204
- foreach ( $exceptions as $key ) {
205
- if ( isset( $this->_data[ $key ] ) ) {
206
- $new_data[ $key ] = $this->_data[ $key ];
207
- }
208
- }
209
-
210
- $this->_data = $new_data;
211
-
212
- if ( $store ) {
213
- $all_data = $this->get_all_data();
214
- $all_data[ $this->_secondary_id ] = $this->_data;
215
- $options_manager = $this->get_option_manager();
216
- $options_manager->set_option( $this->_id, $all_data, true );
217
- }
218
- }
219
-
220
- /**
221
- * Delete key-value storage.
222
- *
223
- * @author Vova Feldman (@svovaf)
224
- * @since 1.0.9
225
- */
226
- function delete() {
227
- $this->_data = array();
228
-
229
- $all_data = $this->get_all_data();
230
- unset( $all_data[ $this->_secondary_id ] );
231
- $options_manager = $this->get_option_manager();
232
- $options_manager->set_option( $this->_id, $all_data, true );
233
- }
234
-
235
- /**
236
- * @author Vova Feldman (@svovaf)
237
- * @since 1.0.7
238
- *
239
- * @param string $key
240
- * @param bool $store
241
- */
242
- function remove( $key, $store = true ) {
243
- if ( ! array_key_exists( $key, $this->_data ) ) {
244
- return;
245
- }
246
-
247
- unset( $this->_data[ $key ] );
248
-
249
- if ( $store ) {
250
- $all_data = $this->get_all_data();
251
- $all_data[ $this->_secondary_id ] = $this->_data;
252
- $options_manager = $this->get_option_manager();
253
- $options_manager->set_option( $this->_id, $all_data, true );
254
- }
255
- }
256
-
257
- /**
258
- * @author Vova Feldman (@svovaf)
259
- * @since 1.0.7
260
- *
261
- * @param string $key
262
- * @param mixed $default
263
- *
264
- * @return bool|\FS_Plugin
265
- */
266
- function get( $key, $default = false ) {
267
- return array_key_exists( $key, $this->_data ) ?
268
- $this->_data[ $key ] :
269
- $default;
270
- }
271
-
272
- /**
273
- * @author Vova Feldman (@svovaf)
274
- * @since 2.0.0
275
- *
276
- * @return string
277
- */
278
- function get_secondary_id() {
279
- return $this->_secondary_id;
280
- }
281
-
282
-
283
- /* ArrayAccess + Magic Access (better for refactoring)
284
- -----------------------------------------------------------------------------------*/
285
- function __set( $k, $v ) {
286
- $this->store( $k, $v );
287
- }
288
-
289
- function __isset( $k ) {
290
- return array_key_exists( $k, $this->_data );
291
- }
292
-
293
- function __unset( $k ) {
294
- $this->remove( $k );
295
- }
296
-
297
- function __get( $k ) {
298
- return $this->get( $k, null );
299
- }
300
-
301
- function offsetSet( $k, $v ) {
302
- if ( is_null( $k ) ) {
303
- throw new Exception( 'Can\'t append value to request params.' );
304
- } else {
305
- $this->{$k} = $v;
306
- }
307
- }
308
-
309
- function offsetExists( $k ) {
310
- return array_key_exists( $k, $this->_data );
311
- }
312
-
313
- function offsetUnset( $k ) {
314
- unset( $this->$k );
315
- }
316
-
317
- function offsetGet( $k ) {
318
- return $this->get( $k, null );
319
- }
320
-
321
- /**
322
- * (PHP 5 &gt;= 5.0.0)<br/>
323
- * Return the current element
324
- *
325
- * @link http://php.net/manual/en/iterator.current.php
326
- * @return mixed Can return any type.
327
- */
328
- public function current() {
329
- return current( $this->_data );
330
- }
331
-
332
- /**
333
- * (PHP 5 &gt;= 5.0.0)<br/>
334
- * Move forward to next element
335
- *
336
- * @link http://php.net/manual/en/iterator.next.php
337
- * @return void Any returned value is ignored.
338
- */
339
- public function next() {
340
- next( $this->_data );
341
- }
342
-
343
- /**
344
- * (PHP 5 &gt;= 5.0.0)<br/>
345
- * Return the key of the current element
346
- *
347
- * @link http://php.net/manual/en/iterator.key.php
348
- * @return mixed scalar on success, or null on failure.
349
- */
350
- public function key() {
351
- return key( $this->_data );
352
- }
353
-
354
- /**
355
- * (PHP 5 &gt;= 5.0.0)<br/>
356
- * Checks if current position is valid
357
- *
358
- * @link http://php.net/manual/en/iterator.valid.php
359
- * @return boolean The return value will be casted to boolean and then evaluated.
360
- * Returns true on success or false on failure.
361
- */
362
- public function valid() {
363
- $key = key( $this->_data );
364
-
365
- return ( $key !== null && $key !== false );
366
- }
367
-
368
- /**
369
- * (PHP 5 &gt;= 5.0.0)<br/>
370
- * Rewind the Iterator to the first element
371
- *
372
- * @link http://php.net/manual/en/iterator.rewind.php
373
- * @return void Any returned value is ignored.
374
- */
375
- public function rewind() {
376
- reset( $this->_data );
377
- }
378
-
379
- /**
380
- * (PHP 5 &gt;= 5.1.0)<br/>
381
- * Count elements of an object
382
- *
383
- * @link http://php.net/manual/en/countable.count.php
384
- * @return int The custom count as an integer.
385
- * </p>
386
- * <p>
387
- * The return value is cast to an integer.
388
- */
389
- public function count() {
390
- return count( $this->_data );
391
- }
392
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Key_Value_Storage
15
+ *
16
+ * @property int $install_timestamp
17
+ * @property int $activation_timestamp
18
+ * @property int $sync_timestamp
19
+ * @property object $sync_cron
20
+ * @property int $install_sync_timestamp
21
+ * @property array $connectivity_test
22
+ * @property array $is_on
23
+ * @property object $trial_plan
24
+ * @property bool $has_trial_plan
25
+ * @property bool $trial_promotion_shown
26
+ * @property string $sdk_version
27
+ * @property string $sdk_last_version
28
+ * @property bool $sdk_upgrade_mode
29
+ * @property bool $sdk_downgrade_mode
30
+ * @property bool $plugin_upgrade_mode
31
+ * @property bool $plugin_downgrade_mode
32
+ * @property string $plugin_version
33
+ * @property string $plugin_last_version
34
+ * @property bool $is_plugin_new_install
35
+ * @property bool $was_plugin_loaded
36
+ * @property object $plugin_main_file
37
+ * @property bool $prev_is_premium
38
+ * @property array $is_anonymous
39
+ * @property bool $is_pending_activation
40
+ * @property bool $sticky_optin_added
41
+ * @property object $uninstall_reason
42
+ * @property object $subscription
43
+ */
44
+ class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
45
+ /**
46
+ * @var string
47
+ */
48
+ protected $_id;
49
+
50
+ /**
51
+ * @since 1.2.2
52
+ *
53
+ * @var string
54
+ */
55
+ protected $_secondary_id;
56
+
57
+ /**
58
+ * @since 2.0.0
59
+ * @var int The ID of the blog that is associated with the current site level options.
60
+ */
61
+ private $_blog_id = 0;
62
+
63
+ /**
64
+ * @since 2.0.0
65
+ * @var bool
66
+ */
67
+ private $_is_multisite_storage;
68
+
69
+ /**
70
+ * @var array
71
+ */
72
+ protected $_data;
73
+
74
+ /**
75
+ * @var FS_Key_Value_Storage[]
76
+ */
77
+ private static $_instances = array();
78
+
79
+ /**
80
+ * @var FS_Logger
81
+ */
82
+ protected $_logger;
83
+
84
+ /**
85
+ * @param string $id
86
+ * @param string $secondary_id
87
+ * @param bool $network_level_or_blog_id
88
+ *
89
+ * @return FS_Key_Value_Storage
90
+ */
91
+ static function instance( $id, $secondary_id, $network_level_or_blog_id = false ) {
92
+ $key = $id . ':' . $secondary_id;
93
+
94
+ if ( is_multisite() ) {
95
+ if ( true === $network_level_or_blog_id ) {
96
+ $key .= ':ms';
97
+ } else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
98
+ $key .= ":{$network_level_or_blog_id}";
99
+ } else {
100
+ $network_level_or_blog_id = get_current_blog_id();
101
+
102
+ $key .= ":{$network_level_or_blog_id}";
103
+ }
104
+ }
105
+
106
+ if ( ! isset( self::$_instances[ $key ] ) ) {
107
+ self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id, $network_level_or_blog_id );
108
+ }
109
+
110
+ return self::$_instances[ $key ];
111
+ }
112
+
113
+ protected function __construct( $id, $secondary_id, $network_level_or_blog_id = false ) {
114
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
115
+
116
+ $this->_id = $id;
117
+ $this->_secondary_id = $secondary_id;
118
+
119
+ if ( is_multisite() ) {
120
+ $this->_is_multisite_storage = ( true === $network_level_or_blog_id );
121
+
122
+ if ( is_numeric( $network_level_or_blog_id ) ) {
123
+ $this->_blog_id = $network_level_or_blog_id;
124
+ }
125
+ } else {
126
+ $this->_is_multisite_storage = false;
127
+ }
128
+
129
+ $this->load();
130
+ }
131
+
132
+ protected function get_option_manager() {
133
+ return FS_Option_Manager::get_manager(
134
+ WP_FS__ACCOUNTS_OPTION_NAME,
135
+ true,
136
+ $this->_is_multisite_storage ?
137
+ true :
138
+ ( $this->_blog_id > 0 ? $this->_blog_id : false )
139
+ );
140
+ }
141
+
142
+ protected function get_all_data() {
143
+ return $this->get_option_manager()->get_option( $this->_id, array() );
144
+ }
145
+
146
+ /**
147
+ * Load plugin data from local DB.
148
+ *
149
+ * @author Vova Feldman (@svovaf)
150
+ * @since 1.0.7
151
+ */
152
+ function load() {
153
+ $all_plugins_data = $this->get_all_data();
154
+ $this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
155
+ $all_plugins_data[ $this->_secondary_id ] :
156
+ array();
157
+ }
158
+
159
+ /**
160
+ * @author Vova Feldman (@svovaf)
161
+ * @since 1.0.7
162
+ *
163
+ * @param string $key
164
+ * @param mixed $value
165
+ * @param bool $flush
166
+ */
167
+ function store( $key, $value, $flush = true ) {
168
+ if ( $this->_logger->is_on() ) {
169
+ $this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
170
+ }
171
+
172
+ if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
173
+ // No need to store data if the value wasn't changed.
174
+ return;
175
+ }
176
+
177
+ $all_data = $this->get_all_data();
178
+
179
+ $this->_data[ $key ] = $value;
180
+
181
+ $all_data[ $this->_secondary_id ] = $this->_data;
182
+
183
+ $options_manager = $this->get_option_manager();
184
+ $options_manager->set_option( $this->_id, $all_data, $flush );
185
+ }
186
+
187
+ /**
188
+ * @author Vova Feldman (@svovaf)
189
+ * @since 2.0.0
190
+ */
191
+ function save() {
192
+ $this->get_option_manager()->store();
193
+ }
194
+
195
+ /**
196
+ * @author Vova Feldman (@svovaf)
197
+ * @since 1.0.7
198
+ *
199
+ * @param bool $store
200
+ * @param string[] $exceptions Set of keys to keep and not clear.
201
+ */
202
+ function clear_all( $store = true, $exceptions = array() ) {
203
+ $new_data = array();
204
+ foreach ( $exceptions as $key ) {
205
+ if ( isset( $this->_data[ $key ] ) ) {
206
+ $new_data[ $key ] = $this->_data[ $key ];
207
+ }
208
+ }
209
+
210
+ $this->_data = $new_data;
211
+
212
+ if ( $store ) {
213
+ $all_data = $this->get_all_data();
214
+ $all_data[ $this->_secondary_id ] = $this->_data;
215
+ $options_manager = $this->get_option_manager();
216
+ $options_manager->set_option( $this->_id, $all_data, true );
217
+ }
218
+ }
219
+
220
+ /**
221
+ * Delete key-value storage.
222
+ *
223
+ * @author Vova Feldman (@svovaf)
224
+ * @since 1.0.9
225
+ */
226
+ function delete() {
227
+ $this->_data = array();
228
+
229
+ $all_data = $this->get_all_data();
230
+ unset( $all_data[ $this->_secondary_id ] );
231
+ $options_manager = $this->get_option_manager();
232
+ $options_manager->set_option( $this->_id, $all_data, true );
233
+ }
234
+
235
+ /**
236
+ * @author Vova Feldman (@svovaf)
237
+ * @since 1.0.7
238
+ *
239
+ * @param string $key
240
+ * @param bool $store
241
+ */
242
+ function remove( $key, $store = true ) {
243
+ if ( ! array_key_exists( $key, $this->_data ) ) {
244
+ return;
245
+ }
246
+
247
+ unset( $this->_data[ $key ] );
248
+
249
+ if ( $store ) {
250
+ $all_data = $this->get_all_data();
251
+ $all_data[ $this->_secondary_id ] = $this->_data;
252
+ $options_manager = $this->get_option_manager();
253
+ $options_manager->set_option( $this->_id, $all_data, true );
254
+ }
255
+ }
256
+
257
+ /**
258
+ * @author Vova Feldman (@svovaf)
259
+ * @since 1.0.7
260
+ *
261
+ * @param string $key
262
+ * @param mixed $default
263
+ *
264
+ * @return bool|\FS_Plugin
265
+ */
266
+ function get( $key, $default = false ) {
267
+ return array_key_exists( $key, $this->_data ) ?
268
+ $this->_data[ $key ] :
269
+ $default;
270
+ }
271
+
272
+ /**
273
+ * @author Vova Feldman (@svovaf)
274
+ * @since 2.0.0
275
+ *
276
+ * @return string
277
+ */
278
+ function get_secondary_id() {
279
+ return $this->_secondary_id;
280
+ }
281
+
282
+
283
+ /* ArrayAccess + Magic Access (better for refactoring)
284
+ -----------------------------------------------------------------------------------*/
285
+ function __set( $k, $v ) {
286
+ $this->store( $k, $v );
287
+ }
288
+
289
+ function __isset( $k ) {
290
+ return array_key_exists( $k, $this->_data );
291
+ }
292
+
293
+ function __unset( $k ) {
294
+ $this->remove( $k );
295
+ }
296
+
297
+ function __get( $k ) {
298
+ return $this->get( $k, null );
299
+ }
300
+
301
+ function offsetSet( $k, $v ) {
302
+ if ( is_null( $k ) ) {
303
+ throw new Exception( 'Can\'t append value to request params.' );
304
+ } else {
305
+ $this->{$k} = $v;
306
+ }
307
+ }
308
+
309
+ function offsetExists( $k ) {
310
+ return array_key_exists( $k, $this->_data );
311
+ }
312
+
313
+ function offsetUnset( $k ) {
314
+ unset( $this->$k );
315
+ }
316
+
317
+ function offsetGet( $k ) {
318
+ return $this->get( $k, null );
319
+ }
320
+
321
+ /**
322
+ * (PHP 5 &gt;= 5.0.0)<br/>
323
+ * Return the current element
324
+ *
325
+ * @link http://php.net/manual/en/iterator.current.php
326
+ * @return mixed Can return any type.
327
+ */
328
+ public function current() {
329
+ return current( $this->_data );
330
+ }
331
+
332
+ /**
333
+ * (PHP 5 &gt;= 5.0.0)<br/>
334
+ * Move forward to next element
335
+ *
336
+ * @link http://php.net/manual/en/iterator.next.php
337
+ * @return void Any returned value is ignored.
338
+ */
339
+ public function next() {
340
+ next( $this->_data );
341
+ }
342
+
343
+ /**
344
+ * (PHP 5 &gt;= 5.0.0)<br/>
345
+ * Return the key of the current element
346
+ *
347
+ * @link http://php.net/manual/en/iterator.key.php
348
+ * @return mixed scalar on success, or null on failure.
349
+ */
350
+ public function key() {
351
+ return key( $this->_data );
352
+ }
353
+
354
+ /**
355
+ * (PHP 5 &gt;= 5.0.0)<br/>
356
+ * Checks if current position is valid
357
+ *
358
+ * @link http://php.net/manual/en/iterator.valid.php
359
+ * @return boolean The return value will be casted to boolean and then evaluated.
360
+ * Returns true on success or false on failure.
361
+ */
362
+ public function valid() {
363
+ $key = key( $this->_data );
364
+
365
+ return ( $key !== null && $key !== false );
366
+ }
367
+
368
+ /**
369
+ * (PHP 5 &gt;= 5.0.0)<br/>
370
+ * Rewind the Iterator to the first element
371
+ *
372
+ * @link http://php.net/manual/en/iterator.rewind.php
373
+ * @return void Any returned value is ignored.
374
+ */
375
+ public function rewind() {
376
+ reset( $this->_data );
377
+ }
378
+
379
+ /**
380
+ * (PHP 5 &gt;= 5.1.0)<br/>
381
+ * Count elements of an object
382
+ *
383
+ * @link http://php.net/manual/en/countable.count.php
384
+ * @return int The custom count as an integer.
385
+ * </p>
386
+ * <p>
387
+ * The return value is cast to an integer.
388
+ */
389
+ public function count() {
390
+ return count( $this->_data );
391
+ }
392
  }
includes/pum-sdk/freemius/includes/managers/class-fs-license-manager.php CHANGED
@@ -1,104 +1,104 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.6
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_License_Manager /*extends FS_Abstract_Manager*/
14
- {
15
- //
16
- //
17
- // /**
18
- // * @var FS_License_Manager[]
19
- // */
20
- // private static $_instances = array();
21
- //
22
- // static function instance( Freemius $fs ) {
23
- // $slug = strtolower( $fs->get_slug() );
24
- //
25
- // if ( ! isset( self::$_instances[ $slug ] ) ) {
26
- // self::$_instances[ $slug ] = new FS_License_Manager( $slug, $fs );
27
- // }
28
- //
29
- // return self::$_instances[ $slug ];
30
- // }
31
- //
32
- //// private function __construct($slug) {
33
- //// parent::__construct($slug);
34
- //// }
35
- //
36
- // function entry_id() {
37
- // return 'licenses';
38
- // }
39
- //
40
- // function sync( $id ) {
41
- //
42
- // }
43
- //
44
- // /**
45
- // * @author Vova Feldman (@svovaf)
46
- // * @since 1.0.5
47
- // * @uses FS_Api
48
- // *
49
- // * @param number|bool $plugin_id
50
- // *
51
- // * @return FS_Plugin_License[]|stdClass Licenses or API error.
52
- // */
53
- // function api_get_user_plugin_licenses( $plugin_id = false ) {
54
- // $api = $this->_fs->get_api_user_scope();
55
- //
56
- // if ( ! is_numeric( $plugin_id ) ) {
57
- // $plugin_id = $this->_fs->get_id();
58
- // }
59
- //
60
- // $result = $api->call( "/plugins/{$plugin_id}/licenses.json" );
61
- //
62
- // if ( ! isset( $result->error ) ) {
63
- // for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) {
64
- // $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] );
65
- // }
66
- //
67
- // $result = $result->licenses;
68
- // }
69
- //
70
- // return $result;
71
- // }
72
- //
73
- // function api_get_many() {
74
- //
75
- // }
76
- //
77
- // function api_activate( $id ) {
78
- //
79
- // }
80
- //
81
- // function api_deactivate( $id ) {
82
- //
83
- // }
84
-
85
- /**
86
- * @param FS_Plugin_License[] $licenses
87
- *
88
- * @return bool
89
- */
90
- static function has_premium_license( $licenses ) {
91
- if ( is_array( $licenses ) ) {
92
- foreach ( $licenses as $license ) {
93
- /**
94
- * @var FS_Plugin_License $license
95
- */
96
- if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
97
- return true;
98
- }
99
- }
100
- }
101
-
102
- return false;
103
- }
104
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.6
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_License_Manager /*extends FS_Abstract_Manager*/
14
+ {
15
+ //
16
+ //
17
+ // /**
18
+ // * @var FS_License_Manager[]
19
+ // */
20
+ // private static $_instances = array();
21
+ //
22
+ // static function instance( Freemius $fs ) {
23
+ // $slug = strtolower( $fs->get_slug() );
24
+ //
25
+ // if ( ! isset( self::$_instances[ $slug ] ) ) {
26
+ // self::$_instances[ $slug ] = new FS_License_Manager( $slug, $fs );
27
+ // }
28
+ //
29
+ // return self::$_instances[ $slug ];
30
+ // }
31
+ //
32
+ //// private function __construct($slug) {
33
+ //// parent::__construct($slug);
34
+ //// }
35
+ //
36
+ // function entry_id() {
37
+ // return 'licenses';
38
+ // }
39
+ //
40
+ // function sync( $id ) {
41
+ //
42
+ // }
43
+ //
44
+ // /**
45
+ // * @author Vova Feldman (@svovaf)
46
+ // * @since 1.0.5
47
+ // * @uses FS_Api
48
+ // *
49
+ // * @param number|bool $plugin_id
50
+ // *
51
+ // * @return FS_Plugin_License[]|stdClass Licenses or API error.
52
+ // */
53
+ // function api_get_user_plugin_licenses( $plugin_id = false ) {
54
+ // $api = $this->_fs->get_api_user_scope();
55
+ //
56
+ // if ( ! is_numeric( $plugin_id ) ) {
57
+ // $plugin_id = $this->_fs->get_id();
58
+ // }
59
+ //
60
+ // $result = $api->call( "/plugins/{$plugin_id}/licenses.json" );
61
+ //
62
+ // if ( ! isset( $result->error ) ) {
63
+ // for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) {
64
+ // $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] );
65
+ // }
66
+ //
67
+ // $result = $result->licenses;
68
+ // }
69
+ //
70
+ // return $result;
71
+ // }
72
+ //
73
+ // function api_get_many() {
74
+ //
75
+ // }
76
+ //
77
+ // function api_activate( $id ) {
78
+ //
79
+ // }
80
+ //
81
+ // function api_deactivate( $id ) {
82
+ //
83
+ // }
84
+
85
+ /**
86
+ * @param FS_Plugin_License[] $licenses
87
+ *
88
+ * @return bool
89
+ */
90
+ static function has_premium_license( $licenses ) {
91
+ if ( is_array( $licenses ) ) {
92
+ foreach ( $licenses as $license ) {
93
+ /**
94
+ * @var FS_Plugin_License $license
95
+ */
96
+ if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
97
+ return true;
98
+ }
99
+ }
100
+ }
101
+
102
+ return false;
103
+ }
104
  }
includes/pum-sdk/freemius/includes/managers/class-fs-option-manager.php CHANGED
@@ -1,490 +1,490 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * 3-layer lazy options manager.
15
- * layer 3: Memory
16
- * layer 2: Cache (if there's any caching plugin and if WP_FS__DEBUG_SDK is FALSE)
17
- * layer 1: Database (options table). All options stored as one option record in the DB to reduce number of DB
18
- * queries.
19
- *
20
- * If load() is not explicitly called, starts as empty manager. Same thing about saving the data - you have to
21
- * explicitly call store().
22
- *
23
- * Class Freemius_Option_Manager
24
- */
25
- class FS_Option_Manager {
26
- /**
27
- * @var string
28
- */
29
- private $_id;
30
- /**
31
- * @var array|object
32
- */
33
- private $_options;
34
- /**
35
- * @var FS_Logger
36
- */
37
- private $_logger;
38
-
39
- /**
40
- * @since 2.0.0
41
- * @var int The ID of the blog that is associated with the current site level options.
42
- */
43
- private $_blog_id = 0;
44
-
45
- /**
46
- * @since 2.0.0
47
- * @var bool
48
- */
49
- private $_is_network_storage;
50
-
51
- /**
52
- * @var array[string]FS_Option_Manager {
53
- * @key string
54
- * @value FS_Option_Manager
55
- * }
56
- */
57
- private static $_MANAGERS = array();
58
-
59
- /**
60
- * @author Vova Feldman (@svovaf)
61
- * @since 1.0.3
62
- *
63
- * @param string $id
64
- * @param bool $load
65
- * @param bool|int $network_level_or_blog_id Since 2.0.0
66
- */
67
- private function __construct( $id, $load = false, $network_level_or_blog_id = false ) {
68
- $id = strtolower( $id );
69
-
70
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_opt_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
71
-
72
- $this->_logger->entrance();
73
- $this->_logger->log( 'id = ' . $id );
74
-
75
- $this->_id = $id;
76
-
77
- if ( is_multisite() ) {
78
- $this->_is_network_storage = ( true === $network_level_or_blog_id );
79
-
80
- if ( is_numeric( $network_level_or_blog_id ) ) {
81
- $this->_blog_id = $network_level_or_blog_id;
82
- }
83
- } else {
84
- $this->_is_network_storage = false;
85
- }
86
-
87
- if ( $load ) {
88
- $this->load();
89
- }
90
- }
91
-
92
- /**
93
- * @author Vova Feldman (@svovaf)
94
- * @since 1.0.3
95
- *
96
- * @param string $id
97
- * @param bool $load
98
- * @param bool|int $network_level_or_blog_id Since 2.0.0
99
- *
100
- * @return FS_Option_Manager
101
- */
102
- static function get_manager( $id, $load = false, $network_level_or_blog_id = false ) {
103
- $key = strtolower( $id );
104
-
105
- if ( is_multisite() ) {
106
- if ( true === $network_level_or_blog_id ) {
107
- $key .= ':ms';
108
- } else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
109
- $key .= ":{$network_level_or_blog_id}";
110
- } else {
111
- $network_level_or_blog_id = get_current_blog_id();
112
-
113
- $key .= ":{$network_level_or_blog_id}";
114
- }
115
- }
116
-
117
- if ( ! isset( self::$_MANAGERS[ $key ] ) ) {
118
- self::$_MANAGERS[ $key ] = new FS_Option_Manager( $id, $load, $network_level_or_blog_id );
119
- } // If load required but not yet loaded, load.
120
- else if ( $load && ! self::$_MANAGERS[ $key ]->is_loaded() ) {
121
- self::$_MANAGERS[ $key ]->load();
122
- }
123
-
124
- return self::$_MANAGERS[ $key ];
125
- }
126
-
127
- /**
128
- * @author Vova Feldman (@svovaf)
129
- * @since 1.0.3
130
- *
131
- * @param bool $flush
132
- */
133
- function load( $flush = false ) {
134
- $this->_logger->entrance();
135
-
136
- $option_name = $this->get_option_manager_name();
137
-
138
- if ( $flush || ! isset( $this->_options ) ) {
139
- if ( isset( $this->_options ) ) {
140
- // Clear prev options.
141
- $this->clear();
142
- }
143
-
144
- $cache_group = $this->get_cache_group();
145
-
146
- if ( ! WP_FS__DEBUG_SDK ) {
147
-
148
- $this->_options = wp_cache_get(
149
- $option_name,
150
- $cache_group
151
- );
152
- }
153
-
154
- $cached = true;
155
-
156
- if ( empty( $this->_options ) ) {
157
- if ( $this->_is_network_storage ) {
158
- $this->_options = get_site_option( $option_name );
159
- } else if ( $this->_blog_id > 0 ) {
160
- $this->_options = get_blog_option( $this->_blog_id, $option_name );
161
- } else {
162
- $this->_options = get_option( $option_name );
163
- }
164
-
165
- if ( is_string( $this->_options ) ) {
166
- $this->_options = json_decode( $this->_options );
167
- }
168
-
169
- // $this->_logger->info('get_option = ' . var_export($this->_options, true));
170
-
171
- if ( false === $this->_options ) {
172
- $this->clear();
173
- }
174
-
175
- $cached = false;
176
- }
177
-
178
- if ( ! WP_FS__DEBUG_SDK && ! $cached ) {
179
- // Set non encoded cache.
180
- wp_cache_set( $option_name, $this->_options, $cache_group );
181
- }
182
- }
183
- }
184
-
185
- /**
186
- * @author Vova Feldman (@svovaf)
187
- * @since 1.0.3
188
- *
189
- * @return bool
190
- */
191
- function is_loaded() {
192
- return isset( $this->_options );
193
- }
194
-
195
- /**
196
- * @author Vova Feldman (@svovaf)
197
- * @since 1.0.3
198
- *
199
- * @return bool
200
- */
201
- function is_empty() {
202
- return ( $this->is_loaded() && false === $this->_options );
203
- }
204
-
205
- /**
206
- * @author Vova Feldman (@svovaf)
207
- * @since 1.0.6
208
- *
209
- * @param bool $flush
210
- */
211
- function clear( $flush = false ) {
212
- $this->_logger->entrance();
213
-
214
- $this->_options = array();
215
-
216
- if ( $flush ) {
217
- $this->store();
218
- }
219
- }
220
-
221
- /**
222
- * Delete options manager from DB.
223
- *
224
- * @author Vova Feldman (@svovaf)
225
- * @since 1.0.9
226
- */
227
- function delete() {
228
- $option_name = $this->get_option_manager_name();
229
-
230
- if ( $this->_is_network_storage ) {
231
- delete_site_option( $option_name );
232
- } else if ( $this->_blog_id > 0 ) {
233
- delete_blog_option( $this->_blog_id, $option_name );
234
- } else {
235
- delete_option( $option_name );
236
- }
237
- }
238
-
239
- /**
240
- * @author Vova Feldman (@svovaf)
241
- * @since 1.0.6
242
- *
243
- * @param string $option
244
- *
245
- * @return bool
246
- */
247
- function has_option( $option ) {
248
- return array_key_exists( $option, $this->_options );
249
- }
250
-
251
- /**
252
- * @author Vova Feldman (@svovaf)
253
- * @since 1.0.3
254
- *
255
- * @param string $option
256
- * @param mixed $default
257
- *
258
- * @return mixed
259
- */
260
- function get_option( $option, $default = null ) {
261
- $this->_logger->entrance( 'option = ' . $option );
262
-
263
- if ( ! $this->is_loaded() ) {
264
- $this->load();
265
- }
266
-
267
- if ( is_array( $this->_options ) ) {
268
- $value = isset( $this->_options[ $option ] ) ?
269
- $this->_options[ $option ] :
270
- $default;
271
- } else if ( is_object( $this->_options ) ) {
272
- $value = isset( $this->_options->{$option} ) ?
273
- $this->_options->{$option} :
274
- $default;
275
- } else {
276
- $value = $default;
277
- }
278
-
279
- /**
280
- * If it's an object, return a clone of the object, otherwise,
281
- * external changes of the object will actually change the value
282
- * of the object in the options manager which may lead to an unexpected
283
- * behaviour and data integrity when a store() call is triggered.
284
- *
285
- * Example:
286
- * $object1 = $options->get_option( 'object1' );
287
- * $object1->x = 123;
288
- *
289
- * $object2 = $options->get_option( 'object2' );
290
- * $object2->y = 'dummy';
291
- *
292
- * $options->set_option( 'object2', $object2, true );
293
- *
294
- * If we don't return a clone of option 'object1', setting 'object2'
295
- * will also store the updated value of 'object1' which is quite not
296
- * an expected behaviour.
297
- *
298
- * @author Vova Feldman
299
- */
300
- return is_object( $value ) ? clone $value : $value;
301
- }
302
-
303
- /**
304
- * @author Vova Feldman (@svovaf)
305
- * @since 1.0.3
306
- *
307
- * @param string $option
308
- * @param mixed $value
309
- * @param bool $flush
310
- */
311
- function set_option( $option, $value, $flush = false ) {
312
- $this->_logger->entrance( 'option = ' . $option );
313
-
314
- if ( ! $this->is_loaded() ) {
315
- $this->clear();
316
- }
317
-
318
- /**
319
- * If it's an object, store a clone of the object, otherwise,
320
- * external changes of the object will actually change the value
321
- * of the object in the options manager which may lead to an unexpected
322
- * behaviour and data integrity when a store() call is triggered.
323
- *
324
- * Example:
325
- * $object1 = new stdClass();
326
- * $object1->x = 123;
327
- *
328
- * $options->set_option( 'object1', $object1 );
329
- *
330
- * $object1->x = 456;
331
- *
332
- * $options->set_option( 'object2', $object2, true );
333
- *
334
- * If we don't set the option as a clone of option 'object1', setting 'object2'
335
- * will also store the updated value of 'object1' ($object1->x = 456 instead of
336
- * $object1->x = 123) which is quite not an expected behaviour.
337
- *
338
- * @author Vova Feldman
339
- */
340
- $copy = is_object( $value ) ? clone $value : $value;
341
-
342
- if ( is_array( $this->_options ) ) {
343
- $this->_options[ $option ] = $copy;
344
- } else if ( is_object( $this->_options ) ) {
345
- $this->_options->{$option} = $copy;
346
- }
347
-
348
- if ( $flush ) {
349
- $this->store();
350
- }
351
- }
352
-
353
- /**
354
- * Unset option.
355
- *
356
- * @author Vova Feldman (@svovaf)
357
- * @since 1.0.3
358
- *
359
- * @param string $option
360
- * @param bool $flush
361
- */
362
- function unset_option( $option, $flush = false ) {
363
- $this->_logger->entrance( 'option = ' . $option );
364
-
365
- if ( is_array( $this->_options ) ) {
366
- if ( ! isset( $this->_options[ $option ] ) ) {
367
- return;
368
- }
369
-
370
- unset( $this->_options[ $option ] );
371
-
372
- } else if ( is_object( $this->_options ) ) {
373
- if ( ! isset( $this->_options->{$option} ) ) {
374
- return;
375
- }
376
-
377
- unset( $this->_options->{$option} );
378
- }
379
-
380
- if ( $flush ) {
381
- $this->store();
382
- }
383
- }
384
-
385
- /**
386
- * Dump options to database.
387
- *
388
- * @author Vova Feldman (@svovaf)
389
- * @since 1.0.3
390
- */
391
- function store() {
392
- $this->_logger->entrance();
393
-
394
- $option_name = $this->get_option_manager_name();
395
-
396
- if ( $this->_logger->is_on() ) {
397
- $this->_logger->info( $option_name . ' = ' . var_export( $this->_options, true ) );
398
- }
399
-
400
- // Update DB.
401
- if ( $this->_is_network_storage ) {
402
- update_site_option( $option_name, $this->_options );
403
- } else if ( $this->_blog_id > 0 ) {
404
- update_blog_option( $this->_blog_id, $option_name, $this->_options );
405
- } else {
406
- update_option( $option_name, $this->_options );
407
- }
408
-
409
- if ( ! WP_FS__DEBUG_SDK ) {
410
- wp_cache_set( $option_name, $this->_options, $this->get_cache_group() );
411
- }
412
- }
413
-
414
- /**
415
- * Get options keys.
416
- *
417
- * @author Vova Feldman (@svovaf)
418
- * @since 1.0.3
419
- *
420
- * @return string[]
421
- */
422
- function get_options_keys() {
423
- if ( is_array( $this->_options ) ) {
424
- return array_keys( $this->_options );
425
- } else if ( is_object( $this->_options ) ) {
426
- return array_keys( get_object_vars( $this->_options ) );
427
- }
428
-
429
- return array();
430
- }
431
-
432
- #--------------------------------------------------------------------------------
433
- #region Migration
434
- #--------------------------------------------------------------------------------
435
-
436
- /**
437
- * Migrate options from site level.
438
- *
439
- * @author Vova Feldman (@svovaf)
440
- * @since 2.0.0
441
- */
442
- function migrate_to_network() {
443
- $site_options = FS_Option_Manager::get_manager($this->_id, true, false);
444
-
445
- $options = is_object( $site_options->_options ) ?
446
- get_object_vars( $site_options->_options ) :
447
- $site_options->_options;
448
-
449
- if ( ! empty( $options ) ) {
450
- foreach ( $options as $key => $val ) {
451
- $this->set_option( $key, $val, false );
452
- }
453
-
454
- $this->store();
455
- }
456
- }
457
-
458
- #endregion
459
-
460
- #--------------------------------------------------------------------------------
461
- #region Helper Methods
462
- #--------------------------------------------------------------------------------
463
-
464
- /**
465
- * @return string
466
- */
467
- private function get_option_manager_name() {
468
- return $this->_id;
469
- }
470
-
471
- /**
472
- * @author Vova Feldman (@svovaf)
473
- * @since 2.0.0
474
- *
475
- * @return string
476
- */
477
- private function get_cache_group() {
478
- $group = WP_FS__SLUG;
479
-
480
- if ( $this->_is_network_storage ) {
481
- $group .= '_ms';
482
- } else if ( $this->_blog_id > 0 ) {
483
- $group .= "_s{$this->_blog_id}";
484
- }
485
-
486
- return $group;
487
- }
488
-
489
- #endregion
490
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * 3-layer lazy options manager.
15
+ * layer 3: Memory
16
+ * layer 2: Cache (if there's any caching plugin and if WP_FS__DEBUG_SDK is FALSE)
17
+ * layer 1: Database (options table). All options stored as one option record in the DB to reduce number of DB
18
+ * queries.
19
+ *
20
+ * If load() is not explicitly called, starts as empty manager. Same thing about saving the data - you have to
21
+ * explicitly call store().
22
+ *
23
+ * Class Freemius_Option_Manager
24
+ */
25
+ class FS_Option_Manager {
26
+ /**
27
+ * @var string
28
+ */
29
+ private $_id;
30
+ /**
31
+ * @var array|object
32
+ */
33
+ private $_options;
34
+ /**
35
+ * @var FS_Logger
36
+ */
37
+ private $_logger;
38
+
39
+ /**
40
+ * @since 2.0.0
41
+ * @var int The ID of the blog that is associated with the current site level options.
42
+ */
43
+ private $_blog_id = 0;
44
+
45
+ /**
46
+ * @since 2.0.0
47
+ * @var bool
48
+ */
49
+ private $_is_network_storage;
50
+
51
+ /**
52
+ * @var array[string]FS_Option_Manager {
53
+ * @key string
54
+ * @value FS_Option_Manager
55
+ * }
56
+ */
57
+ private static $_MANAGERS = array();
58
+
59
+ /**
60
+ * @author Vova Feldman (@svovaf)
61
+ * @since 1.0.3
62
+ *
63
+ * @param string $id
64
+ * @param bool $load
65
+ * @param bool|int $network_level_or_blog_id Since 2.0.0
66
+ */
67
+ private function __construct( $id, $load = false, $network_level_or_blog_id = false ) {
68
+ $id = strtolower( $id );
69
+
70
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_opt_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
71
+
72
+ $this->_logger->entrance();
73
+ $this->_logger->log( 'id = ' . $id );
74
+
75
+ $this->_id = $id;
76
+
77
+ if ( is_multisite() ) {
78
+ $this->_is_network_storage = ( true === $network_level_or_blog_id );
79
+
80
+ if ( is_numeric( $network_level_or_blog_id ) ) {
81
+ $this->_blog_id = $network_level_or_blog_id;
82
+ }
83
+ } else {
84
+ $this->_is_network_storage = false;
85
+ }
86
+
87
+ if ( $load ) {
88
+ $this->load();
89
+ }
90
+ }
91
+
92
+ /**
93
+ * @author Vova Feldman (@svovaf)
94
+ * @since 1.0.3
95
+ *
96
+ * @param string $id
97
+ * @param bool $load
98
+ * @param bool|int $network_level_or_blog_id Since 2.0.0
99
+ *
100
+ * @return FS_Option_Manager
101
+ */
102
+ static function get_manager( $id, $load = false, $network_level_or_blog_id = false ) {
103
+ $key = strtolower( $id );
104
+
105
+ if ( is_multisite() ) {
106
+ if ( true === $network_level_or_blog_id ) {
107
+ $key .= ':ms';
108
+ } else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
109
+ $key .= ":{$network_level_or_blog_id}";
110
+ } else {
111
+ $network_level_or_blog_id = get_current_blog_id();
112
+
113
+ $key .= ":{$network_level_or_blog_id}";
114
+ }
115
+ }
116
+
117
+ if ( ! isset( self::$_MANAGERS[ $key ] ) ) {
118
+ self::$_MANAGERS[ $key ] = new FS_Option_Manager( $id, $load, $network_level_or_blog_id );
119
+ } // If load required but not yet loaded, load.
120
+ else if ( $load && ! self::$_MANAGERS[ $key ]->is_loaded() ) {
121
+ self::$_MANAGERS[ $key ]->load();
122
+ }
123
+
124
+ return self::$_MANAGERS[ $key ];
125
+ }
126
+
127
+ /**
128
+ * @author Vova Feldman (@svovaf)
129
+ * @since 1.0.3
130
+ *
131
+ * @param bool $flush
132
+ */
133
+ function load( $flush = false ) {
134
+ $this->_logger->entrance();
135
+
136
+ $option_name = $this->get_option_manager_name();
137
+
138
+ if ( $flush || ! isset( $this->_options ) ) {
139
+ if ( isset( $this->_options ) ) {
140
+ // Clear prev options.
141
+ $this->clear();
142
+ }
143
+
144
+ $cache_group = $this->get_cache_group();
145
+
146
+ if ( ! WP_FS__DEBUG_SDK ) {
147
+
148
+ $this->_options = wp_cache_get(
149
+ $option_name,
150
+ $cache_group
151
+ );
152
+ }
153
+
154
+ $cached = true;
155
+
156
+ if ( empty( $this->_options ) ) {
157
+ if ( $this->_is_network_storage ) {
158
+ $this->_options = get_site_option( $option_name );
159
+ } else if ( $this->_blog_id > 0 ) {
160
+ $this->_options = get_blog_option( $this->_blog_id, $option_name );
161
+ } else {
162
+ $this->_options = get_option( $option_name );
163
+ }
164
+
165
+ if ( is_string( $this->_options ) ) {
166
+ $this->_options = json_decode( $this->_options );
167
+ }
168
+
169
+ // $this->_logger->info('get_option = ' . var_export($this->_options, true));
170
+
171
+ if ( false === $this->_options ) {
172
+ $this->clear();
173
+ }
174
+
175
+ $cached = false;
176
+ }
177
+
178
+ if ( ! WP_FS__DEBUG_SDK && ! $cached ) {
179
+ // Set non encoded cache.
180
+ wp_cache_set( $option_name, $this->_options, $cache_group );
181
+ }
182
+ }
183
+ }
184
+
185
+ /**
186
+ * @author Vova Feldman (@svovaf)
187
+ * @since 1.0.3
188
+ *
189
+ * @return bool
190
+ */
191
+ function is_loaded() {
192
+ return isset( $this->_options );
193
+ }
194
+
195
+ /**
196
+ * @author Vova Feldman (@svovaf)
197
+ * @since 1.0.3
198
+ *
199
+ * @return bool
200
+ */
201
+ function is_empty() {
202
+ return ( $this->is_loaded() && false === $this->_options );
203
+ }
204
+
205
+ /**
206
+ * @author Vova Feldman (@svovaf)
207
+ * @since 1.0.6
208
+ *
209
+ * @param bool $flush
210
+ */
211
+ function clear( $flush = false ) {
212
+ $this->_logger->entrance();
213
+
214
+ $this->_options = array();
215
+
216
+ if ( $flush ) {
217
+ $this->store();
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Delete options manager from DB.
223
+ *
224
+ * @author Vova Feldman (@svovaf)
225
+ * @since 1.0.9
226
+ */
227
+ function delete() {
228
+ $option_name = $this->get_option_manager_name();
229
+
230
+ if ( $this->_is_network_storage ) {
231
+ delete_site_option( $option_name );
232
+ } else if ( $this->_blog_id > 0 ) {
233
+ delete_blog_option( $this->_blog_id, $option_name );
234
+ } else {
235
+ delete_option( $option_name );
236
+ }
237
+ }
238
+
239
+ /**
240
+ * @author Vova Feldman (@svovaf)
241
+ * @since 1.0.6
242
+ *
243
+ * @param string $option
244
+ *
245
+ * @return bool
246
+ */
247
+ function has_option( $option ) {
248
+ return array_key_exists( $option, $this->_options );
249
+ }
250
+
251
+ /**
252
+ * @author Vova Feldman (@svovaf)
253
+ * @since 1.0.3
254
+ *
255
+ * @param string $option
256
+ * @param mixed $default
257
+ *
258
+ * @return mixed
259
+ */
260
+ function get_option( $option, $default = null ) {
261
+ $this->_logger->entrance( 'option = ' . $option );
262
+
263
+ if ( ! $this->is_loaded() ) {
264
+ $this->load();
265
+ }
266
+
267
+ if ( is_array( $this->_options ) ) {
268
+ $value = isset( $this->_options[ $option ] ) ?
269
+ $this->_options[ $option ] :
270
+ $default;
271
+ } else if ( is_object( $this->_options ) ) {
272
+ $value = isset( $this->_options->{$option} ) ?
273
+ $this->_options->{$option} :
274
+ $default;
275
+ } else {
276
+ $value = $default;
277
+ }
278
+
279
+ /**
280
+ * If it's an object, return a clone of the object, otherwise,
281
+ * external changes of the object will actually change the value
282
+ * of the object in the options manager which may lead to an unexpected
283
+ * behaviour and data integrity when a store() call is triggered.
284
+ *
285
+ * Example:
286
+ * $object1 = $options->get_option( 'object1' );
287
+ * $object1->x = 123;
288
+ *
289
+ * $object2 = $options->get_option( 'object2' );
290
+ * $object2->y = 'dummy';
291
+ *
292
+ * $options->set_option( 'object2', $object2, true );
293
+ *
294
+ * If we don't return a clone of option 'object1', setting 'object2'
295
+ * will also store the updated value of 'object1' which is quite not
296
+ * an expected behaviour.
297
+ *
298
+ * @author Vova Feldman
299
+ */
300
+ return is_object( $value ) ? clone $value : $value;
301
+ }
302
+
303
+ /**
304
+ * @author Vova Feldman (@svovaf)
305
+ * @since 1.0.3
306
+ *
307
+ * @param string $option
308
+ * @param mixed $value
309
+ * @param bool $flush
310
+ */
311
+ function set_option( $option, $value, $flush = false ) {
312
+ $this->_logger->entrance( 'option = ' . $option );
313
+
314
+ if ( ! $this->is_loaded() ) {
315
+ $this->clear();
316
+ }
317
+
318
+ /**
319
+ * If it's an object, store a clone of the object, otherwise,
320
+ * external changes of the object will actually change the value
321
+ * of the object in the options manager which may lead to an unexpected
322
+ * behaviour and data integrity when a store() call is triggered.
323
+ *
324
+ * Example:
325
+ * $object1 = new stdClass();
326
+ * $object1->x = 123;
327
+ *
328
+ * $options->set_option( 'object1', $object1 );
329
+ *
330
+ * $object1->x = 456;
331
+ *
332
+ * $options->set_option( 'object2', $object2, true );
333
+ *
334
+ * If we don't set the option as a clone of option 'object1', setting 'object2'
335
+ * will also store the updated value of 'object1' ($object1->x = 456 instead of
336
+ * $object1->x = 123) which is quite not an expected behaviour.
337
+ *
338
+ * @author Vova Feldman
339
+ */
340
+ $copy = is_object( $value ) ? clone $value : $value;
341
+
342
+ if ( is_array( $this->_options ) ) {
343
+ $this->_options[ $option ] = $copy;
344
+ } else if ( is_object( $this->_options ) ) {
345
+ $this->_options->{$option} = $copy;
346
+ }
347
+
348
+ if ( $flush ) {
349
+ $this->store();
350
+ }
351
+ }
352
+
353
+ /**
354
+ * Unset option.
355
+ *
356
+ * @author Vova Feldman (@svovaf)
357
+ * @since 1.0.3
358
+ *
359
+ * @param string $option
360
+ * @param bool $flush
361
+ */
362
+ function unset_option( $option, $flush = false ) {
363
+ $this->_logger->entrance( 'option = ' . $option );
364
+
365
+ if ( is_array( $this->_options ) ) {
366
+ if ( ! isset( $this->_options[ $option ] ) ) {
367
+ return;
368
+ }
369
+
370
+ unset( $this->_options[ $option ] );
371
+
372
+ } else if ( is_object( $this->_options ) ) {
373
+ if ( ! isset( $this->_options->{$option} ) ) {
374
+ return;
375
+ }
376
+
377
+ unset( $this->_options->{$option} );
378
+ }
379
+
380
+ if ( $flush ) {
381
+ $this->store();
382
+ }
383
+ }
384
+
385
+ /**
386
+ * Dump options to database.
387
+ *
388
+ * @author Vova Feldman (@svovaf)
389
+ * @since 1.0.3
390
+ */
391
+ function store() {
392
+ $this->_logger->entrance();
393
+
394
+ $option_name = $this->get_option_manager_name();
395
+
396
+ if ( $this->_logger->is_on() ) {
397
+ $this->_logger->info( $option_name . ' = ' . var_export( $this->_options, true ) );
398
+ }
399
+
400
+ // Update DB.
401
+ if ( $this->_is_network_storage ) {
402
+ update_site_option( $option_name, $this->_options );
403
+ } else if ( $this->_blog_id > 0 ) {
404
+ update_blog_option( $this->_blog_id, $option_name, $this->_options );
405
+ } else {
406
+ update_option( $option_name, $this->_options );
407
+ }
408
+
409
+ if ( ! WP_FS__DEBUG_SDK ) {
410
+ wp_cache_set( $option_name, $this->_options, $this->get_cache_group() );
411
+ }
412
+ }
413
+
414
+ /**
415
+ * Get options keys.
416
+ *
417
+ * @author Vova Feldman (@svovaf)
418
+ * @since 1.0.3
419
+ *
420
+ * @return string[]
421
+ */
422
+ function get_options_keys() {
423
+ if ( is_array( $this->_options ) ) {
424
+ return array_keys( $this->_options );
425
+ } else if ( is_object( $this->_options ) ) {
426
+ return array_keys( get_object_vars( $this->_options ) );
427
+ }
428
+
429
+ return array();
430
+ }
431
+
432
+ #--------------------------------------------------------------------------------
433
+ #region Migration
434
+ #--------------------------------------------------------------------------------
435
+
436
+ /**
437
+ * Migrate options from site level.
438
+ *
439
+ * @author Vova Feldman (@svovaf)
440
+ * @since 2.0.0
441
+ */
442
+ function migrate_to_network() {
443
+ $site_options = FS_Option_Manager::get_manager($this->_id, true, false);
444
+
445
+ $options = is_object( $site_options->_options ) ?
446
+ get_object_vars( $site_options->_options ) :
447
+ $site_options->_options;
448
+
449
+ if ( ! empty( $options ) ) {
450
+ foreach ( $options as $key => $val ) {
451
+ $this->set_option( $key, $val, false );
452
+ }
453
+
454
+ $this->store();
455
+ }
456
+ }
457
+
458
+ #endregion
459
+
460
+ #--------------------------------------------------------------------------------
461
+ #region Helper Methods
462
+ #--------------------------------------------------------------------------------
463
+
464
+ /**
465
+ * @return string
466
+ */
467
+ private function get_option_manager_name() {
468
+ return $this->_id;
469
+ }
470
+
471
+ /**
472
+ * @author Vova Feldman (@svovaf)
473
+ * @since 2.0.0
474
+ *
475
+ * @return string
476
+ */
477
+ private function get_cache_group() {
478
+ $group = WP_FS__SLUG;
479
+
480
+ if ( $this->_is_network_storage ) {
481
+ $group .= '_ms';
482
+ } else if ( $this->_blog_id > 0 ) {
483
+ $group .= "_s{$this->_blog_id}";
484
+ }
485
+
486
+ return $group;
487
+ }
488
+
489
+ #endregion
490
  }
includes/pum-sdk/freemius/includes/managers/class-fs-plan-manager.php CHANGED
@@ -1,162 +1,162 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.6
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Plan_Manager {
14
- /**
15
- * @var FS_Plan_Manager
16
- */
17
- private static $_instance;
18
-
19
- /**
20
- * @return FS_Plan_Manager
21
- */
22
- static function instance() {
23
- if ( ! isset( self::$_instance ) ) {
24
- self::$_instance = new FS_Plan_Manager();
25
- }
26
-
27
- return self::$_instance;
28
- }
29
-
30
- private function __construct() {
31
- }
32
-
33
- /**
34
- * @param FS_Plugin_License[] $licenses
35
- *
36
- * @return bool
37
- */
38
- function has_premium_license( $licenses ) {
39
- if ( is_array( $licenses ) ) {
40
- /**
41
- * @var FS_Plugin_License[] $licenses
42
- */
43
- foreach ( $licenses as $license ) {
44
- if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
45
- return true;
46
- }
47
- }
48
- }
49
-
50
- return false;
51
- }
52
-
53
- /**
54
- * Check if plugin has any paid plans.
55
- *
56
- * @author Vova Feldman (@svovaf)
57
- * @since 1.0.7
58
- *
59
- * @param FS_Plugin_Plan[] $plans
60
- *
61
- * @return bool
62
- */
63
- function has_paid_plan( $plans ) {
64
- if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
65
- return false;
66
- }
67
-
68
- /**
69
- * @var FS_Plugin_Plan[] $plans
70
- */
71
- for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
72
- if ( ! $plans[ $i ]->is_free() ) {
73
- return true;
74
- }
75
- }
76
-
77
- return false;
78
- }
79
-
80
- /**
81
- * Check if plugin has any free plan, or is it premium only.
82
- *
83
- * Note: If no plans configured, assume plugin is free.
84
- *
85
- * @author Vova Feldman (@svovaf)
86
- * @since 1.0.7
87
- *
88
- * @param FS_Plugin_Plan[] $plans
89
- *
90
- * @return bool
91
- */
92
- function has_free_plan( $plans ) {
93
- if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
94
- return true;
95
- }
96
-
97
- /**
98
- * @var FS_Plugin_Plan[] $plans
99
- */
100
- for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
101
- if ( $plans[ $i ]->is_free() ) {
102
- return true;
103
- }
104
- }
105
-
106
- return false;
107
- }
108
-
109
- /**
110
- * Find all plans that have trial.
111
- *
112
- * @author Vova Feldman (@svovaf)
113
- * @since 1.0.9
114
- *
115
- * @param FS_Plugin_Plan[] $plans
116
- *
117
- * @return FS_Plugin_Plan[]
118
- */
119
- function get_trial_plans( $plans ) {
120
- $trial_plans = array();
121
-
122
- if ( is_array( $plans ) && 0 < count( $plans ) ) {
123
- /**
124
- * @var FS_Plugin_Plan[] $plans
125
- */
126
- for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
127
- if ( $plans[ $i ]->has_trial() ) {
128
- $trial_plans[] = $plans[ $i ];
129
- }
130
- }
131
- }
132
-
133
- return $trial_plans;
134
- }
135
-
136
- /**
137
- * Check if plugin has any trial plan.
138
- *
139
- * @author Vova Feldman (@svovaf)
140
- * @since 1.0.9
141
- *
142
- * @param FS_Plugin_Plan[] $plans
143
- *
144
- * @return bool
145
- */
146
- function has_trial_plan( $plans ) {
147
- if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
148
- return true;
149
- }
150
-
151
- /**
152
- * @var FS_Plugin_Plan[] $plans
153
- */
154
- for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
155
- if ( $plans[ $i ]->has_trial() ) {
156
- return true;
157
- }
158
- }
159
-
160
- return false;
161
- }
162
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.6
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plan_Manager {
14
+ /**
15
+ * @var FS_Plan_Manager
16
+ */
17
+ private static $_instance;
18
+
19
+ /**
20
+ * @return FS_Plan_Manager
21
+ */
22
+ static function instance() {
23
+ if ( ! isset( self::$_instance ) ) {
24
+ self::$_instance = new FS_Plan_Manager();
25
+ }
26
+
27
+ return self::$_instance;
28
+ }
29
+
30
+ private function __construct() {
31
+ }
32
+
33
+ /**
34
+ * @param FS_Plugin_License[] $licenses
35
+ *
36
+ * @return bool
37
+ */
38
+ function has_premium_license( $licenses ) {
39
+ if ( is_array( $licenses ) ) {
40
+ /**
41
+ * @var FS_Plugin_License[] $licenses
42
+ */
43
+ foreach ( $licenses as $license ) {
44
+ if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
45
+ return true;
46
+ }
47
+ }
48
+ }
49
+
50
+ return false;
51
+ }
52
+
53
+ /**
54
+ * Check if plugin has any paid plans.
55
+ *
56
+ * @author Vova Feldman (@svovaf)
57
+ * @since 1.0.7
58
+ *
59
+ * @param FS_Plugin_Plan[] $plans
60
+ *
61
+ * @return bool
62
+ */
63
+ function has_paid_plan( $plans ) {
64
+ if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
65
+ return false;
66
+ }
67
+
68
+ /**
69
+ * @var FS_Plugin_Plan[] $plans
70
+ */
71
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
72
+ if ( ! $plans[ $i ]->is_free() ) {
73
+ return true;
74
+ }
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+ /**
81
+ * Check if plugin has any free plan, or is it premium only.
82
+ *
83
+ * Note: If no plans configured, assume plugin is free.
84
+ *
85
+ * @author Vova Feldman (@svovaf)
86
+ * @since 1.0.7
87
+ *
88
+ * @param FS_Plugin_Plan[] $plans
89
+ *
90
+ * @return bool
91
+ */
92
+ function has_free_plan( $plans ) {
93
+ if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
94
+ return true;
95
+ }
96
+
97
+ /**
98
+ * @var FS_Plugin_Plan[] $plans
99
+ */
100
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
101
+ if ( $plans[ $i ]->is_free() ) {
102
+ return true;
103
+ }
104
+ }
105
+
106
+ return false;
107
+ }
108
+
109
+ /**
110
+ * Find all plans that have trial.
111
+ *
112
+ * @author Vova Feldman (@svovaf)
113
+ * @since 1.0.9
114
+ *
115
+ * @param FS_Plugin_Plan[] $plans
116
+ *
117
+ * @return FS_Plugin_Plan[]
118
+ */
119
+ function get_trial_plans( $plans ) {
120
+ $trial_plans = array();
121
+
122
+ if ( is_array( $plans ) && 0 < count( $plans ) ) {
123
+ /**
124
+ * @var FS_Plugin_Plan[] $plans
125
+ */
126
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
127
+ if ( $plans[ $i ]->has_trial() ) {
128
+ $trial_plans[] = $plans[ $i ];
129
+ }
130
+ }
131
+ }
132
+
133
+ return $trial_plans;
134
+ }
135
+
136
+ /**
137
+ * Check if plugin has any trial plan.
138
+ *
139
+ * @author Vova Feldman (@svovaf)
140
+ * @since 1.0.9
141
+ *
142
+ * @param FS_Plugin_Plan[] $plans
143
+ *
144
+ * @return bool
145
+ */
146
+ function has_trial_plan( $plans ) {
147
+ if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
148
+ return true;
149
+ }
150
+
151
+ /**
152
+ * @var FS_Plugin_Plan[] $plans
153
+ */
154
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
155
+ if ( $plans[ $i ]->has_trial() ) {
156
+ return true;
157
+ }
158
+ }
159
+
160
+ return false;
161
+ }
162
  }
includes/pum-sdk/freemius/includes/managers/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/sdk/Exceptions/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/sdk/LICENSE.txt CHANGED
@@ -1,340 +1,340 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- {description}
294
- Copyright (C) {year} {fullname}
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- {signature of Ty Coon}, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
340
-
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ {description}
294
+ Copyright (C) {year} {fullname}
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ {signature of Ty Coon}, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
340
+
includes/pum-sdk/freemius/includes/sdk/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/includes/supplements/fs-essential-functions-1.1.7.1.php CHANGED
@@ -1,47 +1,43 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Find the plugin main file path based on any given file inside the plugin's folder.
15
- *
16
- * @author Vova Feldman (@svovaf)
17
- * @since 1.1.7.1
18
- *
19
- * @param string $file Absolute path to a file inside a plugin's folder.
20
- *
21
- * @return string
22
- */
23
- function fs_find_direct_caller_plugin_file( $file ) {
24
- /**
25
- * All the code below will be executed once on activation.
26
- * If the user changes the main plugin's file name, the file_exists()
27
- * will catch it.
28
- */
29
- if ( ! function_exists( 'get_plugins' ) ) {
30
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
31
- }
32
-
33
- $all_plugins = get_plugins();
34
-
35
- $file_real_path = fs_normalize_path( realpath( $file ) );
36
-
37
- // Get active plugin's main files real full names (might be symlinks).
38
- foreach ( $all_plugins as $relative_path => &$data ) {
39
- if ( 0 === strpos( $file_real_path, fs_normalize_path( dirname( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ) ) ) ) {
40
- if ( '.' !== dirname( trailingslashit( $relative_path ) ) ) {
41
- return $relative_path;
42
- }
43
- }
44
- }
45
-
46
- return null;
47
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Find the plugin main file path based on any given file inside the plugin's folder.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.1.7.1
18
+ *
19
+ * @param string $file Absolute path to a file inside a plugin's folder.
20
+ *
21
+ * @return string
22
+ */
23
+ function fs_find_direct_caller_plugin_file( $file ) {
24
+ /**
25
+ * All the code below will be executed once on activation.
26
+ * If the user changes the main plugin's file name, the file_exists()
27
+ * will catch it.
28
+ */
29
+ $all_plugins = fs_get_plugins( true );
30
+
31
+ $file_real_path = fs_normalize_path( realpath( $file ) );
32
+
33
+ // Get active plugin's main files real full names (might be symlinks).
34
+ foreach ( $all_plugins as $relative_path => $data ) {
35
+ if ( 0 === strpos( $file_real_path, fs_normalize_path( dirname( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ) ) ) ) {
36
+ if ( '.' !== dirname( trailingslashit( $relative_path ) ) ) {
37
+ return $relative_path;
38
+ }
39
+ }
40
+ }
41
+
42
+ return null;
43
+ }
 
 
 
 
includes/pum-sdk/freemius/includes/supplements/fs-essential-functions-2.2.1.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 2.2.1
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( ! function_exists( 'fs_get_plugins' ) ) {
14
+ /**
15
+ * @author Leo Fajardo (@leorw)
16
+ * @since 2.2.1
17
+ *
18
+ * @param bool $delete_cache
19
+ *
20
+ * @return array
21
+ */
22
+ function fs_get_plugins( $delete_cache = false ) {
23
+ $cached_plugins = wp_cache_get( 'plugins', 'plugins' );
24
+ if ( ! is_array( $cached_plugins ) ) {
25
+ $cached_plugins = array();
26
+ }
27
+
28
+ $plugin_folder = '';
29
+ if ( isset( $cached_plugins[ $plugin_folder ] ) ) {
30
+ $plugins = $cached_plugins[ $plugin_folder ];
31
+ } else {
32
+ if ( ! function_exists( 'get_plugins' ) ) {
33
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
34
+ }
35
+
36
+ $plugins = get_plugins();
37
+
38
+ if ( $delete_cache && is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
39
+ wp_cache_delete( 'plugins', 'plugins' );
40
+ }
41
+ }
42
+
43
+ return $plugins;
44
+ }
45
+ }
includes/pum-sdk/freemius/includes/supplements/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
- // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
1
+ <?php
2
+ // Silence is golden.
3
  // Hide file structure from users on unprotected servers.
includes/pum-sdk/freemius/languages/freemius-da_DK.mo CHANGED
Binary file
includes/pum-sdk/freemius/languages/freemius-da_DK.po CHANGED
@@ -1,2299 +1,2434 @@
1
- # Copyright (C) 2018 freemius
2
- # This file is distributed under the same license as the freemius package.
3
- # Translators:
4
- # Joachim Jensen, 2016-2018
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WordPress SDK\n"
8
- "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: 2018-05-24 11:59+0000\n"
11
- "Last-Translator: Joachim Jensen\n"
12
- "Language: da_DK\n"
13
- "Language-Team: Danish (Denmark) (http://www.transifex.com/freemius/wordpress-sdk/language/da_DK/)\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
- "MIME-Version: 1.0\n"
18
- "X-Poedit-Basepath: ..\n"
19
- "X-Poedit-KeywordsList: get_text_inline;fs_text_inline;fs_echo_inline;fs_esc_js_inline;fs_esc_attr_inline;fs_esc_attr_echo_inline;fs_esc_html_inline;fs_esc_html_echo_inline;get_text_x_inline:1,2c;fs_text_x_inline:1,2c;fs_echo_x_inline:1,2c;fs_esc_attr_x_inline:1,2c;fs_esc_js_x_inline:1,2c;fs_esc_js_echo_x_inline:1,2c;fs_esc_html_x_inline:1,2c;fs_esc_html_echo_x_inline:1,2c\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
- "X-Poedit-SourceCharset: UTF-8\n"
23
-
24
- #: includes/class-freemius.php:1551
25
- msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
26
- msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
27
-
28
- #: includes/class-freemius.php:1553
29
- msgid "Error"
30
- msgstr "Fejl"
31
-
32
- #: includes/class-freemius.php:1871
33
- msgid "I found a better %s"
34
- msgstr "Jeg fandt et bedre %s"
35
-
36
- #: includes/class-freemius.php:1873
37
- msgid "What's the %s's name?"
38
- msgstr "What's the %s's name?"
39
-
40
- #: includes/class-freemius.php:1879
41
- msgid "It's a temporary %s. I'm just debugging an issue."
42
- msgstr "It's a temporary %s. I'm just debugging an issue."
43
-
44
- #: includes/class-freemius.php:1881
45
- msgid "Deactivation"
46
- msgstr "Deaktivering"
47
-
48
- #: includes/class-freemius.php:1882
49
- msgid "Theme Switch"
50
- msgstr "Temaskift"
51
-
52
- #: includes/class-freemius.php1891, templates/forms/resend-key.php:24
53
- msgid "Other"
54
- msgstr "Andet"
55
-
56
- #: includes/class-freemius.php:1899
57
- msgid "I no longer need the %s"
58
- msgstr "Jeg har ikke længere brug for %s"
59
-
60
- #: includes/class-freemius.php:1906
61
- msgid "I only needed the %s for a short period"
62
- msgstr "Jeg behøvede kun %s i en kort periode"
63
-
64
- #: includes/class-freemius.php:1912
65
- msgid "The %s broke my site"
66
- msgstr "%s ødelagde min webside"
67
-
68
- #: includes/class-freemius.php:1919
69
- msgid "The %s suddenly stopped working"
70
- msgstr "%s stoppede pludseligt med at virke"
71
-
72
- #: includes/class-freemius.php:1929
73
- msgid "I can't pay for it anymore"
74
- msgstr "Jeg kan ikke længere betale for det"
75
-
76
- #: includes/class-freemius.php:1931
77
- msgid "What price would you feel comfortable paying?"
78
- msgstr "Hvilken pris ville du foretrække at betale?"
79
-
80
- #: includes/class-freemius.php:1937
81
- msgid "I don't like to share my information with you"
82
- msgstr "Jeg har ikke lyst til at dele mine informationer med jer"
83
-
84
- #: includes/class-freemius.php:1958
85
- msgid "The %s didn't work"
86
- msgstr "%s virkede ikke"
87
-
88
- #: includes/class-freemius.php:1968
89
- msgid "I couldn't understand how to make it work"
90
- msgstr "Jeg forstod ikke, hvordan jeg skulle det til at fungere."
91
-
92
- #: includes/class-freemius.php:1976
93
- msgid "The %s is great, but I need specific feature that you don't support"
94
- msgstr "%s er godt, men jeg har brug for en specifik feature, som ikke understøttes"
95
-
96
- #: includes/class-freemius.php:1978
97
- msgid "What feature?"
98
- msgstr "Hvilken feature?"
99
-
100
- #: includes/class-freemius.php:1982
101
- msgid "The %s is not working"
102
- msgstr "%s virker ikke"
103
-
104
- #: includes/class-freemius.php:1984
105
- msgid "Kindly share what didn't work so we can fix it for future users..."
106
- msgstr "Kindly share what didn't work so we can fix it for future users..."
107
-
108
- #: includes/class-freemius.php:1988
109
- msgid "It's not what I was looking for"
110
- msgstr "Det er ikke, hvad jeg søgte"
111
-
112
- #: includes/class-freemius.php:1990
113
- msgid "What you've been looking for?"
114
- msgstr "What you've been looking for?"
115
-
116
- #: includes/class-freemius.php:1994
117
- msgid "The %s didn't work as expected"
118
- msgstr "%s virkede ikke som forventet"
119
-
120
- #: includes/class-freemius.php:1996
121
- msgid "What did you expect?"
122
- msgstr "Hvad forventede du?"
123
-
124
- #: includes/class-freemius.php2729, templates/debug.php:20
125
- msgid "Freemius Debug"
126
- msgstr "Freemius Debug"
127
-
128
- #: includes/class-freemius.php:3402
129
- msgid "I don't know what is cURL or how to install it, help me!"
130
- msgstr "Jeg ved ikke hvad cURL er, eller hvordan jeg installerer det. Hjælp mig!"
131
-
132
- #: includes/class-freemius.php:3404
133
- msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
134
- msgstr "Vi vil kontakte din udbyder og løse problemet. Når vi har opdatinger i sagen, vil vi følge op med en email til dig %s."
135
-
136
- #: includes/class-freemius.php:3411
137
- msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
138
- msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
139
-
140
- #: includes/class-freemius.php:3516
141
- msgid "Yes - do your thing"
142
- msgstr "Yes - do your thing"
143
-
144
- #: includes/class-freemius.php:3521
145
- msgid "No - just deactivate"
146
- msgstr "Nej - bare deaktiver"
147
-
148
- #: includes/class-freemius.php3566, includes/class-freemius.php4066,
149
- #: includes/class-freemius.php5127, includes/class-freemius.php10941,
150
- #: includes/class-freemius.php14205, includes/class-freemius.php14257,
151
- #: includes/class-freemius.php14319, includes/class-freemius.php16448,
152
- #: includes/class-freemius.php16458, includes/class-freemius.php17014,
153
- #: includes/class-freemius.php17032, includes/class-freemius.php17130,
154
- #: includes/class-freemius.php17866, templates/add-ons.php:43
155
- msgctxt "exclamation"
156
- msgid "Oops"
157
- msgstr "Ups"
158
-
159
- #: includes/class-freemius.php:3635
160
- msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
161
- msgstr "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
162
-
163
- #: includes/class-freemius.php:4063
164
- msgctxt "addonX cannot run without pluginY"
165
- msgid "%s cannot run without %s."
166
- msgstr "%s virker ikke uden %s."
167
-
168
- #: includes/class-freemius.php:4064
169
- msgctxt "addonX cannot run..."
170
- msgid "%s cannot run without the plugin."
171
- msgstr "%s virker ikke uden pluginnet."
172
-
173
- #: includes/class-freemius.php4176, includes/class-freemius.php4201,
174
- #: includes/class-freemius.php:17103
175
- msgid "Unexpected API error. Please contact the %s's author with the following error."
176
- msgstr "Unexpected API error. Please contact the %s's author with the following error."
177
-
178
- #: includes/class-freemius.php:4815
179
- msgid "Premium %s version was successfully activated."
180
- msgstr "Premium %s version was successfully activated."
181
-
182
- #: includes/class-freemius.php4827, includes/class-freemius.php:6660
183
- msgctxt ""
184
- msgid "W00t"
185
- msgstr "W00t"
186
-
187
- #: includes/class-freemius.php:4842
188
- msgid "You have a %s license."
189
- msgstr "Du har en %s licens."
190
-
191
- #: includes/class-freemius.php4846, includes/class-freemius.php13626,
192
- #: includes/class-freemius.php13637, includes/class-freemius.php16376,
193
- #: includes/class-freemius.php16676, includes/class-freemius.php16741,
194
- #: includes/class-freemius.php:16891
195
- msgctxt "interjection expressing joy or exuberance"
196
- msgid "Yee-haw"
197
- msgstr "Yee-haw"
198
-
199
- #: includes/class-freemius.php:5110
200
- msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
201
- msgstr "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
202
-
203
- #: includes/class-freemius.php:5114
204
- msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
205
- msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
206
-
207
- #: includes/class-freemius.php5123, templates/add-ons.php99,
208
- #: templates/account/partials/addon.php:283
209
- msgid "More information about %s"
210
- msgstr "Mere information om %s"
211
-
212
- #: includes/class-freemius.php:5124
213
- msgid "Purchase License"
214
- msgstr "Køb licens"
215
-
216
- #: includes/class-freemius.php6035, templates/connect.php:161
217
- msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
218
- msgstr "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
219
-
220
- #: includes/class-freemius.php:6039
221
- msgid "start the trial"
222
- msgstr "start prøveperioden"
223
-
224
- #: includes/class-freemius.php6040, templates/connect.php:165
225
- msgid "complete the install"
226
- msgstr "færdiggør installeringen"
227
-
228
- #: includes/class-freemius.php:6147
229
- msgid "You are just one step away - %s"
230
- msgstr "Du mangler kun ét skridt - %s"
231
-
232
- #: includes/class-freemius.php:6150
233
- msgctxt "%s - plugin name. As complete \"PluginX\" activation now"
234
- msgid "Complete \"%s\" Activation Now"
235
- msgstr "Færdiggør aktivering af \"%s\" nu"
236
-
237
- #: includes/class-freemius.php:6227
238
- msgid "We made a few tweaks to the %s, %s"
239
- msgstr "We made a few tweaks to the %s, %s"
240
-
241
- #: includes/class-freemius.php:6231
242
- msgid "Opt in to make \"%s\" Better!"
243
- msgstr "Opt in to make \"%s\" Better!"
244
-
245
- #: includes/class-freemius.php:6659
246
- msgid "The upgrade of %s was successfully completed."
247
- msgstr "Opgraderingen af %s blev fuldendt."
248
-
249
- #: includes/class-freemius.php8384, includes/class-fs-plugin-updater.php581,
250
- #: includes/class-fs-plugin-updater.php733,
251
- #: includes/class-fs-plugin-updater.php739, templates/auto-installation.php:32
252
- msgid "Add-On"
253
- msgstr "Tilføjelse"
254
-
255
- #: includes/class-freemius.php8386, templates/debug.php349,
256
- #: templates/debug.php:510
257
- msgid "Plugin"
258
- msgstr "Plugin"
259
-
260
- #: includes/class-freemius.php8387, templates/debug.php349,
261
- #: templates/debug.php510, templates/forms/deactivation/form.php:64
262
- msgid "Theme"
263
- msgstr "Tema"
264
-
265
- #: includes/class-freemius.php:10808
266
- msgid "invalid_site_details_collection"
267
- msgstr "invalid_site_details_collection"
268
-
269
- #: includes/class-freemius.php:10928
270
- msgid "We couldn't find your email address in the system, are you sure it's the right address?"
271
- msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
272
-
273
- #: includes/class-freemius.php:10930
274
- msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
275
- msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
276
-
277
- #: includes/class-freemius.php:11166
278
- msgid "Account is pending activation."
279
- msgstr "Account is pending activation."
280
-
281
- #: includes/class-freemius.php:13608
282
- msgid "%s activation was successfully completed."
283
- msgstr "Aktivering af %s blev gennemført."
284
-
285
- #: includes/class-freemius.php:13622
286
- msgid "Your account was successfully activated with the %s plan."
287
- msgstr "Din konto blev aktiveret med planen %s."
288
-
289
- #: includes/class-freemius.php13633, includes/class-freemius.php:16737
290
- msgid "Your trial has been successfully started."
291
- msgstr "Din prøveperiode er begyndt."
292
-
293
- #: includes/class-freemius.php14203, includes/class-freemius.php14255,
294
- #: includes/class-freemius.php:14317
295
- msgid "Couldn't activate %s."
296
- msgstr "Kunne ikke aktivere %s."
297
-
298
- #: includes/class-freemius.php14204, includes/class-freemius.php14256,
299
- #: includes/class-freemius.php:14318
300
- msgid "Please contact us with the following message:"
301
- msgstr "Kontakt os venligst med følgende besked:"
302
-
303
- #: includes/class-freemius.php14666, includes/class-freemius.php:18929
304
- msgid "Upgrade"
305
- msgstr "Opgrader"
306
-
307
- #: includes/class-freemius.php:14672
308
- msgid "Start Trial"
309
- msgstr "Start prøveperiode"
310
-
311
- #: includes/class-freemius.php:14674
312
- msgid "Pricing"
313
- msgstr "Priser"
314
-
315
- #: includes/class-freemius.php14734, includes/class-freemius.php:14736
316
- msgid "Affiliation"
317
- msgstr "Affiliation"
318
-
319
- #: includes/class-freemius.php14756, includes/class-freemius.php14758,
320
- #: templates/account.php146, templates/debug.php:314
321
- msgid "Account"
322
- msgstr "Konto"
323
-
324
- #: includes/class-freemius.php14769, includes/class-freemius.php14771,
325
- #: includes/customizer/class-fs-customizer-support-section.php:60
326
- msgid "Contact Us"
327
- msgstr "Kontakt os"
328
-
329
- #: includes/class-freemius.php14781, includes/class-freemius.php14783,
330
- #: includes/class-freemius.php18939, templates/account.php96,
331
- #: templates/account/partials/addon.php:37
332
- msgid "Add-Ons"
333
- msgstr "Tilføjelser"
334
-
335
- #: includes/class-freemius.php14815, templates/pricing.php:97
336
- msgctxt "noun"
337
- msgid "Pricing"
338
- msgstr "Priser"
339
-
340
- #: includes/class-freemius.php15009,
341
- #: includes/customizer/class-fs-customizer-support-section.php:67
342
- msgid "Support Forum"
343
- msgstr "Supportforum"
344
-
345
- #: includes/class-freemius.php:15794
346
- msgid "Your email has been successfully verified - you are AWESOME!"
347
- msgstr "Din e-mailadresse er blevet verificeret - du er FOR SEJ!"
348
-
349
- #: includes/class-freemius.php:15795
350
- msgctxt "a positive response"
351
- msgid "Right on"
352
- msgstr "Sådan"
353
-
354
- #: includes/class-freemius.php:16367
355
- msgid "Your %s Add-on plan was successfully upgraded."
356
- msgstr "Your %s Add-on plan was successfully upgraded."
357
-
358
- #: includes/class-freemius.php:16369
359
- msgid "%s Add-on was successfully purchased."
360
- msgstr "Betalingen for tilføjelsen %s blev gennemført."
361
-
362
- #: includes/class-freemius.php:16372
363
- msgid "Download the latest version"
364
- msgstr "Download den seneste version"
365
-
366
- #: includes/class-freemius.php:16444
367
- msgctxt "%1s - plugin title, %2s - API domain"
368
- msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
369
- msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
370
-
371
- #: includes/class-freemius.php16447, includes/class-freemius.php16862,
372
- #: includes/class-freemius.php:16927
373
- msgid "Error received from the server:"
374
- msgstr "Fejl modtager fra serveren:"
375
-
376
- #: includes/class-freemius.php:16457
377
- msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
378
- msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
379
-
380
- #: includes/class-freemius.php16639, includes/class-freemius.php16867,
381
- #: includes/class-freemius.php:16910
382
- msgctxt ""
383
- msgid "Hmm"
384
- msgstr "Hmm"
385
-
386
- #: includes/class-freemius.php:16652
387
- msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
388
- msgstr "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
389
-
390
- #: includes/class-freemius.php16653, templates/account.php98,
391
- #: templates/add-ons.php130, templates/account/partials/addon.php:39
392
- msgctxt "trial period"
393
- msgid "Trial"
394
- msgstr "Prøveperiode"
395
-
396
- #: includes/class-freemius.php:16658
397
- msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
398
- msgstr "I have upgraded my account but when I try to Sync the License, the plan remains %s."
399
-
400
- #: includes/class-freemius.php16662, includes/class-freemius.php:16719
401
- msgid "Please contact us here"
402
- msgstr "Kontakt os her"
403
-
404
- #: includes/class-freemius.php:16672
405
- msgid "Your plan was successfully upgraded."
406
- msgstr "Din plan er blevet opgraderet."
407
-
408
- #: includes/class-freemius.php:16689
409
- msgid "Your plan was successfully changed to %s."
410
- msgstr "Din plan er blevet ændret til %s."
411
-
412
- #: includes/class-freemius.php:16705
413
- msgid "Your license has expired. You can still continue using the free %s forever."
414
- msgstr "Your license has expired. You can still continue using the free %s forever."
415
-
416
- #: includes/class-freemius.php:16707
417
- msgid "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
418
- msgstr "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
419
-
420
- #: includes/class-freemius.php:16715
421
- msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
422
- msgstr "Din licens er blevet annulleret. Hvis du mener, dette er en fejl, så kontakt venligst support."
423
-
424
- #: includes/class-freemius.php:16728
425
- msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
426
- msgstr "Din licens er udløbet. Du kan stadig benytte alle funktionerne i %s, men du bliver nødt til at fornye din licens for at få opdateringer og support."
427
-
428
- #: includes/class-freemius.php:16751
429
- msgid "Your free trial has expired. You can still continue using all our free features."
430
- msgstr "Your free trial has expired. You can still continue using all our free features."
431
-
432
- #: includes/class-freemius.php:16753
433
- msgid "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
434
- msgstr "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
435
-
436
- #: includes/class-freemius.php:16858
437
- msgid "It looks like the license could not be activated."
438
- msgstr "Det ser ud til, at licensen ikke kunne aktiveres."
439
-
440
- #: includes/class-freemius.php:16888
441
- msgid "Your license was successfully activated."
442
- msgstr "Din licens er blevet aktiveret."
443
-
444
- #: includes/class-freemius.php:16914
445
- msgid "It looks like your site currently doesn't have an active license."
446
- msgstr "Det ser ud til, at dit websted endnu ikke har en aktiv licens."
447
-
448
- #: includes/class-freemius.php:16926
449
- msgid "It looks like the license deactivation failed."
450
- msgstr "Det ser ud til, at licens-deaktiveringen mislykkedes."
451
-
452
- #: includes/class-freemius.php:16954
453
- msgid "Your license was successfully deactivated, you are back to the %s plan."
454
- msgstr "Din licens blev deaktiveret, du er tilbage på planen %s."
455
-
456
- #: includes/class-freemius.php:16955
457
- msgid "O.K"
458
- msgstr "O.K"
459
-
460
- #: includes/class-freemius.php:17003
461
- msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
462
- msgstr "Din plan blev nedgraderet. Licensen til din %s plan vil udløbe om %s."
463
-
464
- #: includes/class-freemius.php:17013
465
- msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
466
- msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
467
-
468
- #: includes/class-freemius.php:17037
469
- msgid "You are already running the %s in a trial mode."
470
- msgstr "You are already running the %s in a trial mode."
471
-
472
- #: includes/class-freemius.php:17048
473
- msgid "You already utilized a trial before."
474
- msgstr "Du har allerede brugt din prøveperiode."
475
-
476
- #: includes/class-freemius.php:17062
477
- msgid "Plan %s do not exist, therefore, can't start a trial."
478
- msgstr "Plan %s eksisterer ikke og kan derfor ikke starte prøveperiode."
479
-
480
- #: includes/class-freemius.php:17073
481
- msgid "Plan %s does not support a trial period."
482
- msgstr "Plan %s understøtter ikke en prøveperiode."
483
-
484
- #: includes/class-freemius.php:17084
485
- msgid "None of the %s's plans supports a trial period."
486
- msgstr "None of the %s's plans supports a trial period."
487
-
488
- #: includes/class-freemius.php:17134
489
- msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
490
- msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
491
-
492
- #: includes/class-freemius.php:17185
493
- msgid "Your %s free trial was successfully cancelled."
494
- msgstr "Din gratis prøveperiode for %s er blevet annulleret."
495
-
496
- #: includes/class-freemius.php:17190
497
- msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
498
- msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
499
-
500
- #: includes/class-freemius.php:17474
501
- msgid "Version %s was released."
502
- msgstr "Version %s er blevet udgivet."
503
-
504
- #: includes/class-freemius.php:17474
505
- msgid "Please download %s."
506
- msgstr "Download venligst %s."
507
-
508
- #: includes/class-freemius.php:17481
509
- msgid "the latest %s version here"
510
- msgstr "den seneste version af %s her"
511
-
512
- #: includes/class-freemius.php:17486
513
- msgid "New"
514
- msgstr "Ny"
515
-
516
- #: includes/class-freemius.php:17491
517
- msgid "Seems like you got the latest release."
518
- msgstr "Det ser ud til, at du har den seneste udgivelse."
519
-
520
- #: includes/class-freemius.php:17492
521
- msgid "You are all good!"
522
- msgstr "Det var det!"
523
-
524
- #: includes/class-freemius.php:17758
525
- msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
526
- msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
527
-
528
- #: includes/class-freemius.php:17893
529
- msgid "Site successfully opted in."
530
- msgstr "Site successfully opted in."
531
-
532
- #: includes/class-freemius.php17894, includes/class-freemius.php:18671
533
- msgid "Awesome"
534
- msgstr "Sejt"
535
-
536
- #: includes/class-freemius.php17910, templates/forms/optout.php:32
537
- msgid "We appreciate your help in making the %s better by letting us track some usage data."
538
- msgstr "We appreciate your help in making the %s better by letting us track some usage data."
539
-
540
- #: includes/class-freemius.php:17911
541
- msgid "Thank you!"
542
- msgstr "Thank you!"
543
-
544
- #: includes/class-freemius.php:17918
545
- msgid "We will no longer be sending any usage data of %s on %s to %s."
546
- msgstr "We will no longer be sending any usage data of %s on %s to %s."
547
-
548
- #: includes/class-freemius.php:18033
549
- msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
550
- msgstr "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
551
-
552
- #: includes/class-freemius.php:18039
553
- msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
554
- msgstr "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
555
-
556
- #: includes/class-freemius.php:18044
557
- msgid "%s is the new owner of the account."
558
- msgstr "%s er den nye ejer af kontoen."
559
-
560
- #: includes/class-freemius.php:18046
561
- msgctxt "as congratulations"
562
- msgid "Congrats"
563
- msgstr "Tillykke"
564
-
565
- #: includes/class-freemius.php:18066
566
- msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
567
- msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
568
-
569
- #: includes/class-freemius.php:18067
570
- msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
571
- msgstr "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
572
-
573
- #: includes/class-freemius.php:18074
574
- msgid "Change Ownership"
575
- msgstr "Skift ejerskab"
576
-
577
- #: includes/class-freemius.php:18082
578
- msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
579
- msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
580
-
581
- #: includes/class-freemius.php:18094
582
- msgid "Please provide your full name."
583
- msgstr "Indtast venligst dit fulde navn."
584
-
585
- #: includes/class-freemius.php:18099
586
- msgid "Your name was successfully updated."
587
- msgstr "Dit navn er blevet opdateret."
588
-
589
- #: includes/class-freemius.php:18160
590
- msgid "You have successfully updated your %s."
591
- msgstr "Opdatering af %s blev gennemført."
592
-
593
- #: includes/class-freemius.php:18300
594
- msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
595
- msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
596
-
597
- #: includes/class-freemius.php:18301
598
- msgctxt "advance notice of something that will need attention."
599
- msgid "Heads up"
600
- msgstr "Se her"
601
-
602
- #: includes/class-freemius.php:18711
603
- msgctxt "exclamation"
604
- msgid "Hey"
605
- msgstr "Hey"
606
-
607
- #: includes/class-freemius.php:18711
608
- msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
609
- msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
610
-
611
- #: includes/class-freemius.php:18719
612
- msgid "No commitment for %s days - cancel anytime!"
613
- msgstr "Ingen bindinger i %s dage - annuller når som helst!"
614
-
615
- #: includes/class-freemius.php:18720
616
- msgid "No credit card required"
617
- msgstr "Betalingskort ikke påkrævet"
618
-
619
- #: includes/class-freemius.php18727, templates/forms/trial-start.php:53
620
- msgctxt "call to action"
621
- msgid "Start free trial"
622
- msgstr "Start gratis prøveperiode"
623
-
624
- #: includes/class-freemius.php:18804
625
- msgid "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!"
626
- msgstr "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!"
627
-
628
- #: includes/class-freemius.php:18813
629
- msgid "Learn more"
630
- msgstr "Læs mere"
631
-
632
- #: includes/class-freemius.php18963, templates/account.php394,
633
- #: templates/account.php497, templates/connect.php169,
634
- #: templates/connect.php408, templates/forms/license-activation.php24,
635
- #: templates/account/partials/addon.php:230
636
- msgid "Activate License"
637
- msgstr "Aktiver licens"
638
-
639
- #: includes/class-freemius.php18964, templates/account.php457,
640
- #: templates/account.php496, templates/account/partials/site.php:256
641
- msgid "Change License"
642
- msgstr "Skift licens"
643
-
644
- #: includes/class-freemius.php19046, templates/account/partials/site.php:161
645
- msgid "Opt Out"
646
- msgstr "Frameld"
647
-
648
- #: includes/class-freemius.php19048, includes/class-freemius.php19053,
649
- #: templates/account/partials/site.php43,
650
- #: templates/account/partials/site.php:161
651
- msgid "Opt In"
652
- msgstr "Tilmeld"
653
-
654
- #: includes/class-freemius.php:19245
655
- msgid "Please follow these steps to complete the upgrade"
656
- msgstr "Følg venligst disse trin for at færdiggøre opgraderingen"
657
-
658
- #: includes/class-freemius.php:19249
659
- msgid "Download the latest %s version"
660
- msgstr "Download den seneste version af %s"
661
-
662
- #: includes/class-freemius.php:19253
663
- msgid "Upload and activate the downloaded version"
664
- msgstr "Upload og aktiver den downloadede version"
665
-
666
- #: includes/class-freemius.php:19255
667
- msgid "How to upload and activate?"
668
- msgstr "Upload og aktivering, hvordan?"
669
-
670
- #: includes/class-freemius.php:19384
671
- msgid "%sClick here%s to choose the sites where you'd like to activate the license on."
672
- msgstr "%sClick here%s to choose the sites where you'd like to activate the license on."
673
-
674
- #: includes/class-freemius.php:19545
675
- msgid "Auto installation only works for opted-in users."
676
- msgstr "Auto installation only works for opted-in users."
677
-
678
- #: includes/class-freemius.php19555, includes/class-freemius.php19588,
679
- #: includes/class-fs-plugin-updater.php713,
680
- #: includes/class-fs-plugin-updater.php:727
681
- msgid "Invalid module ID."
682
- msgstr "Ugyldigt modul-ID."
683
-
684
- #: includes/class-freemius.php19564, includes/class-fs-plugin-updater.php:747
685
- msgid "Premium version already active."
686
- msgstr "Premium version allerede aktiv."
687
-
688
- #: includes/class-freemius.php:19571
689
- msgid "You do not have a valid license to access the premium version."
690
- msgstr "Du har ikke en gyldig licens til at benytte premium-versionen."
691
-
692
- #: includes/class-freemius.php:19578
693
- msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
694
- msgstr "Plugin is a \"Serviceware\" which means it does not have a premium code version."
695
-
696
- #: includes/class-freemius.php19596, includes/class-fs-plugin-updater.php:746
697
- msgid "Premium add-on version already installed."
698
- msgstr "Premium tilføjelse er allerede installeret."
699
-
700
- #: includes/class-freemius.php:19941
701
- msgid "View paid features"
702
- msgstr "Vis betalte features"
703
-
704
- #: includes/class-freemius.php:20251
705
- msgid "Thank you so much for using %s and its add-ons!"
706
- msgstr "Thank you so much for using %s and its add-ons!"
707
-
708
- #: includes/class-freemius.php:20252
709
- msgid "Thank you so much for using %s!"
710
- msgstr "Thank you so much for using %s!"
711
-
712
- #: includes/class-freemius.php:20258
713
- msgid "You've already opted-in to our usage-tracking, which helps us keep improving the %s."
714
- msgstr "You've already opted-in to our usage-tracking, which helps us keep improving the %s."
715
-
716
- #: includes/class-freemius.php:20262
717
- msgid "Thank you so much for using our products!"
718
- msgstr "Thank you so much for using our products!"
719
-
720
- #: includes/class-freemius.php:20263
721
- msgid "You've already opted-in to our usage-tracking, which helps us keep improving them."
722
- msgstr "You've already opted-in to our usage-tracking, which helps us keep improving them."
723
-
724
- #: includes/class-freemius.php:20282
725
- msgid "%s and its add-ons"
726
- msgstr "%s and its add-ons"
727
-
728
- #: includes/class-freemius.php:20291
729
- msgid "Products"
730
- msgstr "Products"
731
-
732
- #: includes/class-freemius.php20298, templates/connect.php:259
733
- msgid "Yes"
734
- msgstr "Yes"
735
-
736
- #: includes/class-freemius.php20299, templates/connect.php:260
737
- msgid "send me security & feature updates, educational content and offers."
738
- msgstr "send me security & feature updates, educational content and offers."
739
-
740
- #: includes/class-freemius.php20300, templates/connect.php:265
741
- msgid "No"
742
- msgstr "No"
743
-
744
- #: includes/class-freemius.php20302, templates/connect.php:267
745
- msgid "do %sNOT%s send me security & feature updates, educational content and offers."
746
- msgstr "do %sNOT%s send me security & feature updates, educational content and offers."
747
-
748
- #: includes/class-freemius.php:20312
749
- msgid "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard 🙂"
750
- msgstr "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard 🙂"
751
-
752
- #: includes/class-freemius.php20314, templates/connect.php:274
753
- msgid "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:"
754
- msgstr "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:"
755
-
756
- #: includes/class-freemius.php:20598
757
- msgid "License key is empty."
758
- msgstr "License key is empty."
759
-
760
- #: includes/class-fs-plugin-updater.php184,
761
- #: includes/class-fs-plugin-updater.php:219
762
- msgid "%sRenew your license now%s to access version %s security & feature updates, and support."
763
- msgstr "%sRenew your license now%s to access version %s security & feature updates, and support."
764
-
765
- #: includes/class-fs-plugin-updater.php:776
766
- msgid "Installing plugin: %s"
767
- msgstr "Installerer plugin: %s"
768
-
769
- #: includes/class-fs-plugin-updater.php:817
770
- msgid "Unable to connect to the filesystem. Please confirm your credentials."
771
- msgstr "Unable to connect to the filesystem. Please confirm your credentials."
772
-
773
- #: includes/class-fs-plugin-updater.php:923
774
- msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
775
- msgstr "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
776
-
777
- #: includes/fs-plugin-info-dialog.php336,
778
- #: templates/account/partials/addon.php:287
779
- msgctxt "verb"
780
- msgid "Purchase"
781
- msgstr "Køb"
782
-
783
- #: includes/fs-plugin-info-dialog.php:339
784
- msgid "Start my free %s"
785
- msgstr "Start min gratis %s"
786
-
787
- #: includes/fs-plugin-info-dialog.php:380
788
- msgid "Install Free Version Now"
789
- msgstr "Install Free Version Now"
790
-
791
- #: includes/fs-plugin-info-dialog.php381, templates/auto-installation.php111,
792
- #: templates/account/partials/addon.php267,
793
- #: templates/account/partials/addon.php:317
794
- msgid "Install Now"
795
- msgstr "Installer nu"
796
-
797
- #: includes/fs-plugin-info-dialog.php:392
798
- msgctxt "as download latest version"
799
- msgid "Download Latest Free Version"
800
- msgstr "Download Latest Free Version"
801
-
802
- #: includes/fs-plugin-info-dialog.php393, templates/account.php80,
803
- #: templates/account/partials/addon.php:21
804
- msgctxt "as download latest version"
805
- msgid "Download Latest"
806
- msgstr "Download seneste"
807
-
808
- #: includes/fs-plugin-info-dialog.php:403
809
- msgid "Install Free Version Update Now"
810
- msgstr "Install Free Version Update Now"
811
-
812
- #: includes/fs-plugin-info-dialog.php404, templates/account.php:448
813
- msgid "Install Update Now"
814
- msgstr "Installer opdatering nu"
815
-
816
- #: includes/fs-plugin-info-dialog.php:415
817
- msgid "Newer Free Version (%s) Installed"
818
- msgstr "Newer Free Version (%s) Installed"
819
-
820
- #: includes/fs-plugin-info-dialog.php:416
821
- msgid "Newer Version (%s) Installed"
822
- msgstr "Nyere version (%s) installeret"
823
-
824
- #: includes/fs-plugin-info-dialog.php:424
825
- msgid "Latest Free Version Installed"
826
- msgstr "Latest Free Version Installed"
827
-
828
- #: includes/fs-plugin-info-dialog.php:425
829
- msgid "Latest Version Installed"
830
- msgstr "Seneste version installeret"
831
-
832
- #: includes/fs-plugin-info-dialog.php:580
833
- msgctxt "Plugin installer section title"
834
- msgid "Description"
835
- msgstr "Beskrivelse"
836
-
837
- #: includes/fs-plugin-info-dialog.php:581
838
- msgctxt "Plugin installer section title"
839
- msgid "Installation"
840
- msgstr "Installering"
841
-
842
- #: includes/fs-plugin-info-dialog.php:582
843
- msgctxt "Plugin installer section title"
844
- msgid "FAQ"
845
- msgstr "FAQ"
846
-
847
- #: includes/fs-plugin-info-dialog.php583,
848
- #: templates/plugin-info/description.php:55
849
- msgid "Screenshots"
850
- msgstr "Skærmbilleder"
851
-
852
- #: includes/fs-plugin-info-dialog.php:584
853
- msgctxt "Plugin installer section title"
854
- msgid "Changelog"
855
- msgstr "Ændringslog"
856
-
857
- #: includes/fs-plugin-info-dialog.php:585
858
- msgctxt "Plugin installer section title"
859
- msgid "Reviews"
860
- msgstr "Anmeldelser"
861
-
862
- #: includes/fs-plugin-info-dialog.php:586
863
- msgctxt "Plugin installer section title"
864
- msgid "Other Notes"
865
- msgstr "Andre noter"
866
-
867
- #: includes/fs-plugin-info-dialog.php:601
868
- msgctxt "Plugin installer section title"
869
- msgid "Features & Pricing"
870
- msgstr "Funktioner og priser"
871
-
872
- #: includes/fs-plugin-info-dialog.php:611
873
- msgid "Plugin Install"
874
- msgstr "Plugin-installering"
875
-
876
- #: includes/fs-plugin-info-dialog.php:683
877
- msgctxt "e.g. Professional Plan"
878
- msgid "%s Plan"
879
- msgstr "%s Plan"
880
-
881
- #: includes/fs-plugin-info-dialog.php:709
882
- msgctxt "e.g. the best product"
883
- msgid "Best"
884
- msgstr "Bedste"
885
-
886
- #: includes/fs-plugin-info-dialog.php715,
887
- #: includes/fs-plugin-info-dialog.php:735
888
- msgctxt "as every month"
889
- msgid "Monthly"
890
- msgstr "Månedligt"
891
-
892
- #: includes/fs-plugin-info-dialog.php:718
893
- msgctxt "as once a year"
894
- msgid "Annual"
895
- msgstr "Årligt"
896
-
897
- #: includes/fs-plugin-info-dialog.php:721
898
- msgid "Lifetime"
899
- msgstr "Livstid"
900
-
901
- #: includes/fs-plugin-info-dialog.php735,
902
- #: includes/fs-plugin-info-dialog.php737,
903
- #: includes/fs-plugin-info-dialog.php:739
904
- msgctxt "e.g. billed monthly"
905
- msgid "Billed %s"
906
- msgstr "Faktureret %s"
907
-
908
- #: includes/fs-plugin-info-dialog.php:737
909
- msgctxt "as once a year"
910
- msgid "Annually"
911
- msgstr "Årligt"
912
-
913
- #: includes/fs-plugin-info-dialog.php:739
914
- msgctxt "as once a year"
915
- msgid "Once"
916
- msgstr "Engangsbeløb"
917
-
918
- #: includes/fs-plugin-info-dialog.php:745
919
- msgid "Single Site License"
920
- msgstr "Single Site License"
921
-
922
- #: includes/fs-plugin-info-dialog.php:747
923
- msgid "Unlimited Licenses"
924
- msgstr "Ubegrænsede licenser"
925
-
926
- #: includes/fs-plugin-info-dialog.php:749
927
- msgid "Up to %s Sites"
928
- msgstr "Op til %s websteder"
929
-
930
- #: includes/fs-plugin-info-dialog.php759,
931
- #: templates/plugin-info/features.php:82
932
- msgctxt "as monthly period"
933
- msgid "mo"
934
- msgstr "md"
935
-
936
- #: includes/fs-plugin-info-dialog.php766,
937
- #: templates/plugin-info/features.php:80
938
- msgctxt "as annual period"
939
- msgid "year"
940
- msgstr "år"
941
-
942
- #: includes/fs-plugin-info-dialog.php:820
943
- msgctxt "noun"
944
- msgid "Price"
945
- msgstr "Pris"
946
-
947
- #: includes/fs-plugin-info-dialog.php:868
948
- msgid "Save %s"
949
- msgstr "Spar %s"
950
-
951
- #: includes/fs-plugin-info-dialog.php:878
952
- msgid "No commitment for %s - cancel anytime"
953
- msgstr "Ingen bindinger ved %s - annuller når som helst"
954
-
955
- #: includes/fs-plugin-info-dialog.php:881
956
- msgid "After your free %s, pay as little as %s"
957
- msgstr "Efter din gratis %s er prisen kun %s"
958
-
959
- #: includes/fs-plugin-info-dialog.php:892
960
- msgid "Details"
961
- msgstr "Detaljer"
962
-
963
- #: includes/fs-plugin-info-dialog.php896, templates/account.php87,
964
- #: templates/debug.php191, templates/debug.php228, templates/debug.php442,
965
- #: templates/account/partials/addon.php:28
966
- msgctxt "product version"
967
- msgid "Version"
968
- msgstr "Version"
969
-
970
- #: includes/fs-plugin-info-dialog.php:903
971
- msgctxt "as the plugin author"
972
- msgid "Author"
973
- msgstr "Forfatter"
974
-
975
- #: includes/fs-plugin-info-dialog.php:910
976
- msgid "Last Updated"
977
- msgstr "Senest opdateret"
978
-
979
- #: includes/fs-plugin-info-dialog.php:915
980
- msgctxt "x-ago"
981
- msgid "%s ago"
982
- msgstr "%s siden"
983
-
984
- #: includes/fs-plugin-info-dialog.php:924
985
- msgid "Requires WordPress Version"
986
- msgstr "Kræver WordPress-version"
987
-
988
- #: includes/fs-plugin-info-dialog.php:925
989
- msgid "%s or higher"
990
- msgstr "%s eller højere"
991
-
992
- #: includes/fs-plugin-info-dialog.php:932
993
- msgid "Compatible up to"
994
- msgstr "Kompatibel op til"
995
-
996
- #: includes/fs-plugin-info-dialog.php:940
997
- msgid "Downloaded"
998
- msgstr "Downloadet"
999
-
1000
- #: includes/fs-plugin-info-dialog.php:944
1001
- msgid "%s time"
1002
- msgstr "%s gang"
1003
-
1004
- #: includes/fs-plugin-info-dialog.php:946
1005
- msgid "%s times"
1006
- msgstr "%s gange"
1007
-
1008
- #: includes/fs-plugin-info-dialog.php:956
1009
- msgid "WordPress.org Plugin Page"
1010
- msgstr "WordPress.org Plugin-side"
1011
-
1012
- #: includes/fs-plugin-info-dialog.php:964
1013
- msgid "Plugin Homepage"
1014
- msgstr "Plugin-websted"
1015
-
1016
- #: includes/fs-plugin-info-dialog.php972,
1017
- #: includes/fs-plugin-info-dialog.php:1054
1018
- msgid "Donate to this plugin"
1019
- msgstr "Donér til dette plugin"
1020
-
1021
- #: includes/fs-plugin-info-dialog.php:979
1022
- msgid "Average Rating"
1023
- msgstr "Gennemsnitlig vurdering"
1024
-
1025
- #: includes/fs-plugin-info-dialog.php:986
1026
- msgid "based on %s"
1027
- msgstr "baseret på %s"
1028
-
1029
- #: includes/fs-plugin-info-dialog.php:990
1030
- msgid "%s rating"
1031
- msgstr "%s vurdering"
1032
-
1033
- #: includes/fs-plugin-info-dialog.php:992
1034
- msgid "%s ratings"
1035
- msgstr "%s vurderinger"
1036
-
1037
- #: includes/fs-plugin-info-dialog.php:1007
1038
- msgid "%s star"
1039
- msgstr "%s stjerne"
1040
-
1041
- #: includes/fs-plugin-info-dialog.php:1009
1042
- msgid "%s stars"
1043
- msgstr "%s stjerner"
1044
-
1045
- #: includes/fs-plugin-info-dialog.php:1020
1046
- msgid "Click to see reviews that provided a rating of %s"
1047
- msgstr "Click to see reviews that provided a rating of %s"
1048
-
1049
- #: includes/fs-plugin-info-dialog.php:1033
1050
- msgid "Contributors"
1051
- msgstr "Bidragsydere"
1052
-
1053
- #: includes/fs-plugin-info-dialog.php1062,
1054
- #: includes/fs-plugin-info-dialog.php:1064
1055
- msgid "Warning"
1056
- msgstr "Advarsel"
1057
-
1058
- #: includes/fs-plugin-info-dialog.php:1062
1059
- msgid "This plugin has not been tested with your current version of WordPress."
1060
- msgstr "Dette plugin er ikke blevet testet med din nuværende version af WordPress."
1061
-
1062
- #: includes/fs-plugin-info-dialog.php:1064
1063
- msgid "This plugin has not been marked as compatible with your version of WordPress."
1064
- msgstr "This plugin has not been marked as compatible with your version of WordPress."
1065
-
1066
- #: includes/fs-plugin-info-dialog.php:1083
1067
- msgid "Paid add-on must be deployed to Freemius."
1068
- msgstr "Paid add-on must be deployed to Freemius."
1069
-
1070
- #: includes/fs-plugin-info-dialog.php:1084
1071
- msgid "Add-on must be deployed to WordPress.org or Freemius."
1072
- msgstr "Add-on must be deployed to WordPress.org or Freemius."
1073
-
1074
- #: templates/account.php81, templates/account/partials/addon.php22,
1075
- #: templates/account/partials/site.php:295
1076
- msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
1077
- msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
1078
-
1079
- #: templates/account.php82, templates/account/partials/addon.php:23
1080
- msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
1081
- msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
1082
-
1083
- #: templates/account.php83, templates/account/partials/addon.php24,
1084
- #: templates/account/partials/site.php:296
1085
- msgid "You can still enjoy all %s features but you will not have access to %s updates and support."
1086
- msgstr "You can still enjoy all %s features but you will not have access to %s updates and support."
1087
-
1088
- #: templates/account.php84, templates/account/partials/addon.php25,
1089
- #: templates/account/partials/site.php:297
1090
- msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
1091
- msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
1092
-
1093
- #. translators: %s: Plan title (e.g. "Professional")
1094
- #: templates/account.php86,
1095
- #: templates/account/partials/activate-license-button.php31,
1096
- #: templates/account/partials/addon.php:27
1097
- msgid "Activate %s Plan"
1098
- msgstr "Aktiver %s plan"
1099
-
1100
- #. translators: %s: Time period (e.g. Auto renews in "2 months")
1101
- #: templates/account.php89, templates/account/partials/addon.php30,
1102
- #: templates/account/partials/site.php:275
1103
- msgid "Auto renews in %s"
1104
- msgstr "Auto-fornyer om %s"
1105
-
1106
- #. translators: %s: Time period (e.g. Expires in "2 months")
1107
- #: templates/account.php91, templates/account/partials/addon.php32,
1108
- #: templates/account/partials/site.php:277
1109
- msgid "Expires in %s"
1110
- msgstr "Udløber om %s"
1111
-
1112
- #: templates/account.php92, templates/account/partials/addon.php:33
1113
- msgctxt "as synchronize license"
1114
- msgid "Sync License"
1115
- msgstr "Synkroniser licens"
1116
-
1117
- #: templates/account.php93, templates/account/partials/addon.php:34
1118
- msgid "Cancel Trial"
1119
- msgstr "Annuller prøveperiode"
1120
-
1121
- #: templates/account.php94, templates/account/partials/addon.php:35
1122
- msgid "Change Plan"
1123
- msgstr "Skift plan"
1124
-
1125
- #: templates/account.php95, templates/account/partials/addon.php:36
1126
- msgctxt "verb"
1127
- msgid "Upgrade"
1128
- msgstr "Opgrader"
1129
-
1130
- #: templates/account.php97, templates/account/partials/addon.php38,
1131
- #: templates/account/partials/site.php:298
1132
- msgctxt "verb"
1133
- msgid "Downgrade"
1134
- msgstr "Nedgrader"
1135
-
1136
- #: templates/account.php99, templates/add-ons.php126,
1137
- #: templates/plugin-info/features.php72,
1138
- #: templates/account/partials/addon.php40,
1139
- #: templates/account/partials/site.php:31
1140
- msgid "Free"
1141
- msgstr "Gratis"
1142
-
1143
- #: templates/account.php100, templates/account/partials/addon.php:41
1144
- msgid "Activate"
1145
- msgstr "Aktiver"
1146
-
1147
- #: templates/account.php101, templates/debug.php361,
1148
- #: includes/customizer/class-fs-customizer-upsell-control.php106,
1149
- #: templates/account/partials/addon.php:42
1150
- msgctxt "as product pricing plan"
1151
- msgid "Plan"
1152
- msgstr "Plan"
1153
-
1154
- #: templates/account.php:154
1155
- msgid "Free Trial"
1156
- msgstr "Gratis prøveperiode"
1157
-
1158
- #: templates/account.php:165
1159
- msgid "Account Details"
1160
- msgstr "Kontodetaljer"
1161
-
1162
- #: templates/account.php:175
1163
- msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
1164
- msgstr "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
1165
-
1166
- #: templates/account.php:177
1167
- msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
1168
- msgstr "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
1169
-
1170
- #: templates/account.php:180
1171
- msgid "Delete Account"
1172
- msgstr "Slet konto"
1173
-
1174
- #: templates/account.php192, templates/account/partials/addon.php155,
1175
- #: templates/account/partials/deactivate-license-button.php:35
1176
- msgid "Deactivate License"
1177
- msgstr "Deaktiver licens"
1178
-
1179
- #: templates/account.php:210
1180
- msgid "Are you sure you want to proceed?"
1181
- msgstr "Er du sikker på, du vil fortsætte?"
1182
-
1183
- #: templates/account.php210, templates/account/partials/addon.php:177
1184
- msgid "Cancel Subscription"
1185
- msgstr "Annuller abonnement"
1186
-
1187
- #: templates/account.php:239
1188
- msgctxt "as synchronize"
1189
- msgid "Sync"
1190
- msgstr "Synkroniser"
1191
-
1192
- #: templates/account.php253, templates/debug.php:477
1193
- msgid "Name"
1194
- msgstr "Navn"
1195
-
1196
- #: templates/account.php259, templates/debug.php:478
1197
- msgid "Email"
1198
- msgstr "E-mail"
1199
-
1200
- #: templates/account.php266, templates/debug.php360, templates/debug.php:516
1201
- msgid "User ID"
1202
- msgstr "Bruger-ID"
1203
-
1204
- #: templates/account.php:274
1205
- msgid "Site ID"
1206
- msgstr "Websteds-ID"
1207
-
1208
- #: templates/account.php:277
1209
- msgid "No ID"
1210
- msgstr "Intet ID"
1211
-
1212
- #: templates/account.php282, templates/debug.php233, templates/debug.php362,
1213
- #: templates/debug.php443, templates/debug.php480,
1214
- #: templates/account/partials/site.php:219
1215
- msgid "Public Key"
1216
- msgstr "Offentlig nøgle"
1217
-
1218
- #: templates/account.php288, templates/debug.php363, templates/debug.php444,
1219
- #: templates/debug.php481, templates/account/partials/site.php:231
1220
- msgid "Secret Key"
1221
- msgstr "Privat nøgle"
1222
-
1223
- #: templates/account.php:291
1224
- msgctxt "as secret encryption key missing"
1225
- msgid "No Secret"
1226
- msgstr "Ingen privat nøgle"
1227
-
1228
- #: templates/account.php310, templates/account/partials/site.php112,
1229
- #: templates/account/partials/site.php:114
1230
- msgid "Trial"
1231
- msgstr "Prøveperiode"
1232
-
1233
- #: templates/account.php329, templates/debug.php521,
1234
- #: templates/account/partials/site.php:248
1235
- msgid "License Key"
1236
- msgstr "Licensnøgle"
1237
-
1238
- #: templates/account.php:359
1239
- msgid "not verified"
1240
- msgstr "ikke verificeret"
1241
-
1242
- #: templates/account.php:416
1243
- msgid "Premium version"
1244
- msgstr "Premium version"
1245
-
1246
- #: templates/account.php:418
1247
- msgid "Free version"
1248
- msgstr "Gratis version"
1249
-
1250
- #: templates/account.php:430
1251
- msgid "Verify Email"
1252
- msgstr "Verificer e-mail"
1253
-
1254
- #: templates/account.php:441
1255
- msgid "Download %s Version"
1256
- msgstr "Download 1%s version"
1257
-
1258
- #: templates/account.php455, templates/account.php636,
1259
- #: templates/account/partials/site.php237,
1260
- #: templates/account/partials/site.php:255
1261
- msgctxt "verb"
1262
- msgid "Show"
1263
- msgstr "Vis"
1264
-
1265
- #: templates/account.php:469
1266
- msgid "What is your %s?"
1267
- msgstr "Angiv venligst %s?"
1268
-
1269
- #: templates/account.php477, templates/account/billing.php:27
1270
- msgctxt "verb"
1271
- msgid "Edit"
1272
- msgstr "Rediger"
1273
-
1274
- #: templates/account.php:490
1275
- msgid "Sites"
1276
- msgstr "Websteder"
1277
-
1278
- #: templates/account.php:501
1279
- msgid "Search by address"
1280
- msgstr "Search by address"
1281
-
1282
- #: templates/account.php510, templates/account.php558, templates/debug.php226,
1283
- #: templates/debug.php354, templates/debug.php439, templates/debug.php476,
1284
- #: templates/debug.php514, templates/debug.php587,
1285
- #: templates/account/payments.php35, templates/debug/logger.php:21
1286
- msgid "ID"
1287
- msgstr "ID"
1288
-
1289
- #: templates/account.php511, templates/debug.php:357
1290
- msgid "Address"
1291
- msgstr "Address"
1292
-
1293
- #: templates/account.php:512
1294
- msgid "License"
1295
- msgstr "Licens"
1296
-
1297
- #: templates/account.php:513
1298
- msgid "Plan"
1299
- msgstr "Plan"
1300
-
1301
- #: templates/account.php:561
1302
- msgctxt "as software license"
1303
- msgid "License"
1304
- msgstr "Licens"
1305
-
1306
- #: templates/account.php:630
1307
- msgctxt "verb"
1308
- msgid "Hide"
1309
- msgstr "Skjul"
1310
-
1311
- #: templates/account.php:665
1312
- msgid "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?"
1313
- msgstr "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?"
1314
-
1315
- #: templates/add-ons.php:36
1316
- msgid "Add Ons for %s"
1317
- msgstr "Tilføjelser til %s"
1318
-
1319
- #: templates/add-ons.php:44
1320
- msgid "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
1321
- msgstr "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
1322
-
1323
- #: templates/add-ons.php:135
1324
- msgid "View details"
1325
- msgstr "Vis detaljer"
1326
-
1327
- #: templates/admin-notice.php13, templates/forms/license-activation.php208,
1328
- #: templates/forms/resend-key.php:77
1329
- msgctxt "as close a window"
1330
- msgid "Dismiss"
1331
- msgstr "Fjern"
1332
-
1333
- #: templates/auto-installation.php:45
1334
- msgid "%s sec"
1335
- msgstr "1%s sek"
1336
-
1337
- #: templates/auto-installation.php:83
1338
- msgid "Automatic Installation"
1339
- msgstr "Automatisk installering"
1340
-
1341
- #: templates/auto-installation.php:93
1342
- msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1343
- msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1344
-
1345
- #: templates/auto-installation.php:104
1346
- msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1347
- msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1348
-
1349
- #: templates/auto-installation.php:109
1350
- msgid "Cancel Installation"
1351
- msgstr "Annuller installering"
1352
-
1353
- #: templates/checkout.php:172
1354
- msgid "Checkout"
1355
- msgstr "Udtjekning"
1356
-
1357
- #: templates/checkout.php:172
1358
- msgid "PCI compliant"
1359
- msgstr "PCI compliant"
1360
-
1361
- #. translators: %s: name (e.g. Hey John,)
1362
- #: templates/connect.php:110
1363
- msgctxt "greeting"
1364
- msgid "Hey %s,"
1365
- msgstr "Hey %s,"
1366
-
1367
- #: templates/connect.php:152
1368
- msgid "Allow & Continue"
1369
- msgstr "Tillad & Fortsæt"
1370
-
1371
- #: templates/connect.php:156
1372
- msgid "Re-send activation email"
1373
- msgstr "Gensend e-mail om aktivering"
1374
-
1375
- #: templates/connect.php:160
1376
- msgid "Thanks %s!"
1377
- msgstr "Tak %s!"
1378
-
1379
- #: templates/connect.php170, templates/forms/license-activation.php:43
1380
- msgid "Agree & Activate License"
1381
- msgstr "Accepter & aktiver licens"
1382
-
1383
- #: templates/connect.php:179
1384
- msgid "Thanks for purchasing %s! To get started, please enter your license key:"
1385
- msgstr "Tak for at købe %s! For at komme i gang, venligst indtast din licensnøgle:"
1386
-
1387
- #: templates/connect.php:186
1388
- msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s."
1389
- msgstr "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s."
1390
-
1391
- #: templates/connect.php:187
1392
- msgid "Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
1393
- msgstr "Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
1394
-
1395
- #: templates/connect.php:193
1396
- msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1397
- msgstr "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1398
-
1399
- #: templates/connect.php:194
1400
- msgid "Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1401
- msgstr "Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1402
-
1403
- #: templates/connect.php:228
1404
- msgid "We're excited to introduce the Freemius network-level integration."
1405
- msgstr "We're excited to introduce the Freemius network-level integration."
1406
-
1407
- #: templates/connect.php:231
1408
- msgid "During the update process we detected %d site(s) that are still pending license activation."
1409
- msgstr "During the update process we detected %d site(s) that are still pending license activation."
1410
-
1411
- #: templates/connect.php:233
1412
- msgid "If you'd like to use the %s on those sites, please enter your license key below and click the activation button."
1413
- msgstr "If you'd like to use the %s on those sites, please enter your license key below and click the activation button."
1414
-
1415
- #: templates/connect.php:235
1416
- msgid "%s's paid features"
1417
- msgstr "%s's paid features"
1418
-
1419
- #: templates/connect.php:240
1420
- msgid "Alternatively, you can skip it for now and activate the license later, in your %s's network-level Account page."
1421
- msgstr "Alternatively, you can skip it for now and activate the license later, in your %s's network-level Account page."
1422
-
1423
- #: templates/connect.php:242
1424
- msgid "During the update process we detected %s site(s) in the network that are still pending your attention."
1425
- msgstr "During the update process we detected %s site(s) in the network that are still pending your attention."
1426
-
1427
- #: templates/connect.php251, templates/forms/license-activation.php:46
1428
- msgid "License key"
1429
- msgstr "Licensnøgle"
1430
-
1431
- #: templates/connect.php254, templates/forms/license-activation.php:19
1432
- msgid "Can't find your license key?"
1433
- msgstr "Kan du ikke finde din licensnøgle?"
1434
-
1435
- #: templates/connect.php302, templates/connect.php617,
1436
- #: templates/forms/deactivation/retry-skip.php:20
1437
- msgctxt "verb"
1438
- msgid "Skip"
1439
- msgstr "Spring over"
1440
-
1441
- #: templates/connect.php:305
1442
- msgid "Delegate to Site Admins"
1443
- msgstr "Delegate to Site Admins"
1444
-
1445
- #: templates/connect.php:305
1446
- msgid "If you click it, this decision will be delegated to the sites administrators."
1447
- msgstr "If you click it, this decision will be delegated to the sites administrators."
1448
-
1449
- #: templates/connect.php:333
1450
- msgid "Your Profile Overview"
1451
- msgstr "Overblik af din profil"
1452
-
1453
- #: templates/connect.php:334
1454
- msgid "Name and email address"
1455
- msgstr "Navn og e-mailadresse"
1456
-
1457
- #: templates/connect.php:339
1458
- msgid "Your Site Overview"
1459
- msgstr "Overblik af dit websted"
1460
-
1461
- #: templates/connect.php:340
1462
- msgid "Site URL, WP version, PHP info, plugins & themes"
1463
- msgstr "Websteds-URL, WP version, PHP info, plugins og temaer"
1464
-
1465
- #: templates/connect.php:345
1466
- msgid "Admin Notices"
1467
- msgstr "Admin-meddelelser"
1468
-
1469
- #: templates/connect.php346, templates/connect.php:362
1470
- msgid "Updates, announcements, marketing, no spam"
1471
- msgstr "Updates, announcements, marketing, no spam"
1472
-
1473
- #: templates/connect.php:351
1474
- msgid "Current %s Events"
1475
- msgstr "Current %s Events"
1476
-
1477
- #: templates/connect.php:352
1478
- msgid "Activation, deactivation and uninstall"
1479
- msgstr "Aktivering, deaktivering og afinstallering"
1480
-
1481
- #: templates/connect.php:361
1482
- msgid "Newsletter"
1483
- msgstr "Nyhedsbrev"
1484
-
1485
- #: templates/connect.php378, templates/forms/license-activation.php:38
1486
- msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
1487
- msgstr "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
1488
-
1489
- #: templates/connect.php:383
1490
- msgid "What permissions are being granted?"
1491
- msgstr "Hvilke tilladelser bliver givet?"
1492
-
1493
- #: templates/connect.php:404
1494
- msgid "Don't have a license key?"
1495
- msgstr "Har du ikke en licensnøgle?"
1496
-
1497
- #: templates/connect.php:405
1498
- msgid "Activate Free Version"
1499
- msgstr "Aktiver gratis version"
1500
-
1501
- #: templates/connect.php:407
1502
- msgid "Have a license key?"
1503
- msgstr "Har du en licensnøgle?"
1504
-
1505
- #: templates/connect.php:415
1506
- msgid "Privacy Policy"
1507
- msgstr "Privatlivspolitik"
1508
-
1509
- #: templates/connect.php:417
1510
- msgid "Terms of Service"
1511
- msgstr "Servicevilkår"
1512
-
1513
- #: templates/connect.php:750
1514
- msgctxt "as in the process of sending an email"
1515
- msgid "Sending email"
1516
- msgstr "Sender e-mail"
1517
-
1518
- #: templates/connect.php:751
1519
- msgctxt "as activating plugin"
1520
- msgid "Activating"
1521
- msgstr "Aktiverer"
1522
-
1523
- #: templates/contact.php:78
1524
- msgid "Contact"
1525
- msgstr "Kontakt"
1526
-
1527
- #: templates/debug.php:17
1528
- msgctxt "as turned off"
1529
- msgid "Off"
1530
- msgstr "Fra"
1531
-
1532
- #: templates/debug.php:18
1533
- msgctxt "as turned on"
1534
- msgid "On"
1535
- msgstr "Til"
1536
-
1537
- #: templates/debug.php:20
1538
- msgid "SDK"
1539
- msgstr "SDK"
1540
-
1541
- #: templates/debug.php:24
1542
- msgctxt "as code debugging"
1543
- msgid "Debugging"
1544
- msgstr "Fejlfinding"
1545
-
1546
- #: templates/debug.php54, templates/debug.php238, templates/debug.php364,
1547
- #: templates/debug.php:482
1548
- msgid "Actions"
1549
- msgstr "Handlinger"
1550
-
1551
- #: templates/debug.php:64
1552
- msgid "Are you sure you want to delete all Freemius data?"
1553
- msgstr "Er du sikker på, du vil slette al Freemius data?"
1554
-
1555
- #: templates/debug.php:64
1556
- msgid "Delete All Accounts"
1557
- msgstr "Slet alle konti"
1558
-
1559
- #: templates/debug.php:71
1560
- msgid "Clear API Cache"
1561
- msgstr "Ryd API-cache"
1562
-
1563
- #: templates/debug.php:79
1564
- msgid "Clear Updates Transients"
1565
- msgstr "Clear Updates Transients"
1566
-
1567
- #: templates/debug.php:86
1568
- msgid "Sync Data From Server"
1569
- msgstr "Synkroniser data fra server"
1570
-
1571
- #: templates/debug.php:90
1572
- msgid "Load DB Option"
1573
- msgstr "Hent DB-indstilling"
1574
-
1575
- #: templates/debug.php:93
1576
- msgid "Set DB Option"
1577
- msgstr "Sæt DB-indstilling"
1578
-
1579
- #: templates/debug.php:170
1580
- msgid "Key"
1581
- msgstr "Nøgle"
1582
-
1583
- #: templates/debug.php:171
1584
- msgid "Value"
1585
- msgstr "Værdi"
1586
-
1587
- #: templates/debug.php:187
1588
- msgctxt "as software development kit versions"
1589
- msgid "SDK Versions"
1590
- msgstr "SDK-versioner"
1591
-
1592
- #: templates/debug.php:192
1593
- msgid "SDK Path"
1594
- msgstr "SDK-sti"
1595
-
1596
- #: templates/debug.php193, templates/debug.php:232
1597
- msgid "Module Path"
1598
- msgstr "Modul-sti"
1599
-
1600
- #: templates/debug.php:194
1601
- msgid "Is Active"
1602
- msgstr "Er aktiv"
1603
-
1604
- #: templates/debug.php222, templates/debug/plugins-themes-sync.php:35
1605
- msgid "Plugins"
1606
- msgstr "Plugins"
1607
-
1608
- #: templates/debug.php222, templates/debug/plugins-themes-sync.php:56
1609
- msgid "Themes"
1610
- msgstr "Temaer"
1611
-
1612
- #: templates/debug.php227, templates/debug.php359, templates/debug.php441,
1613
- #: templates/debug/scheduled-crons.php:80
1614
- msgid "Slug"
1615
- msgstr "Kortnavn"
1616
-
1617
- #: templates/debug.php229, templates/debug.php:440
1618
- msgid "Title"
1619
- msgstr "Titel"
1620
-
1621
- #: templates/debug.php:230
1622
- msgctxt "as application program interface"
1623
- msgid "API"
1624
- msgstr "API"
1625
-
1626
- #: templates/debug.php:231
1627
- msgid "Freemius State"
1628
- msgstr "Freemius tilstand"
1629
-
1630
- #: templates/debug.php:235
1631
- msgid "Network Blog"
1632
- msgstr "Network Blog"
1633
-
1634
- #: templates/debug.php:236
1635
- msgid "Network User"
1636
- msgstr "Network User"
1637
-
1638
- #: templates/debug.php:273
1639
- msgctxt "as connection was successful"
1640
- msgid "Connected"
1641
- msgstr "Forbundet"
1642
-
1643
- #: templates/debug.php:274
1644
- msgctxt "as connection blocked"
1645
- msgid "Blocked"
1646
- msgstr "Blokeret"
1647
-
1648
- #: templates/debug.php:310
1649
- msgid "Simulate Trial"
1650
- msgstr "Simuler prøveperiode"
1651
-
1652
- #: templates/debug.php:322
1653
- msgid "Simulate Network Upgrade"
1654
- msgstr "Simulate Network Upgrade"
1655
-
1656
- #: templates/debug.php:348
1657
- msgid "%s Installs"
1658
- msgstr "%s installeringer"
1659
-
1660
- #: templates/debug.php:350
1661
- msgctxt "like websites"
1662
- msgid "Sites"
1663
- msgstr "Websteder"
1664
-
1665
- #: templates/debug.php356, templates/account/partials/site.php:148
1666
- msgid "Blog ID"
1667
- msgstr "Blog ID"
1668
-
1669
- #: templates/debug.php421, templates/debug.php499,
1670
- #: templates/account/partials/addon.php:334
1671
- msgctxt "verb"
1672
- msgid "Delete"
1673
- msgstr "Slet"
1674
-
1675
- #: templates/debug.php:435
1676
- msgid "Add Ons of module %s"
1677
- msgstr "Tilføjelser til modul %s"
1678
-
1679
- #: templates/debug.php:472
1680
- msgid "Users"
1681
- msgstr "Brugere"
1682
-
1683
- #: templates/debug.php:479
1684
- msgid "Verified"
1685
- msgstr "Verificeret"
1686
-
1687
- #: templates/debug.php:510
1688
- msgid "%s Licenses"
1689
- msgstr "1%s licenser"
1690
-
1691
- #: templates/debug.php:515
1692
- msgid "Plugin ID"
1693
- msgstr "Plugin-ID"
1694
-
1695
- #: templates/debug.php:517
1696
- msgid "Plan ID"
1697
- msgstr "Plan-ID"
1698
-
1699
- #: templates/debug.php:518
1700
- msgid "Quota"
1701
- msgstr "Kvote"
1702
-
1703
- #: templates/debug.php:519
1704
- msgid "Activated"
1705
- msgstr "Aktiveret"
1706
-
1707
- #: templates/debug.php:520
1708
- msgid "Blocking"
1709
- msgstr "Blokerer"
1710
-
1711
- #: templates/debug.php:522
1712
- msgctxt "as expiration date"
1713
- msgid "Expiration"
1714
- msgstr "Udløber"
1715
-
1716
- #: templates/debug.php:545
1717
- msgid "Debug Log"
1718
- msgstr "Fejlfindingslog"
1719
-
1720
- #: templates/debug.php:549
1721
- msgid "All Types"
1722
- msgstr "Alle typer"
1723
-
1724
- #: templates/debug.php:556
1725
- msgid "All Requests"
1726
- msgstr "Alle forespørgsler"
1727
-
1728
- #: templates/debug.php561, templates/debug.php590,
1729
- #: templates/debug/logger.php:25
1730
- msgid "File"
1731
- msgstr "Fil"
1732
-
1733
- #: templates/debug.php562, templates/debug.php588,
1734
- #: templates/debug/logger.php:23
1735
- msgid "Function"
1736
- msgstr "Funktion"
1737
-
1738
- #: templates/debug.php:563
1739
- msgid "Process ID"
1740
- msgstr "Proces-ID"
1741
-
1742
- #: templates/debug.php:564
1743
- msgid "Logger"
1744
- msgstr "Logger"
1745
-
1746
- #: templates/debug.php565, templates/debug.php589,
1747
- #: templates/debug/logger.php:24
1748
- msgid "Message"
1749
- msgstr "Besked"
1750
-
1751
- #: templates/debug.php:567
1752
- msgid "Filter"
1753
- msgstr "Filter"
1754
-
1755
- #: templates/debug.php:575
1756
- msgid "Download"
1757
- msgstr "Download"
1758
-
1759
- #: templates/debug.php586, templates/debug/logger.php:22
1760
- msgid "Type"
1761
- msgstr "Type"
1762
-
1763
- #: templates/debug.php591, templates/debug/logger.php:26
1764
- msgid "Timestamp"
1765
- msgstr "Timestamp"
1766
-
1767
- #: templates/secure-https-header.php:28
1768
- msgid "Secure HTTPS %s page, running from an external domain"
1769
- msgstr "Secure HTTPS %s page, running from an external domain"
1770
-
1771
- #: includes/customizer/class-fs-customizer-support-section.php55,
1772
- #: templates/plugin-info/features.php:43
1773
- msgid "Support"
1774
- msgstr "Support"
1775
-
1776
- #: includes/debug/class-fs-debug-bar-panel.php48,
1777
- #: templates/debug/api-calls.php54, templates/debug/logger.php:62
1778
- msgctxt "milliseconds"
1779
- msgid "ms"
1780
- msgstr "ms"
1781
-
1782
- #: includes/debug/debug-bar-start.php:41
1783
- msgid "Freemius API"
1784
- msgstr "Freemius API"
1785
-
1786
- #: includes/debug/debug-bar-start.php:42
1787
- msgid "Requests"
1788
- msgstr "Requests"
1789
-
1790
- #: templates/account/billing.php:28
1791
- msgctxt "verb"
1792
- msgid "Update"
1793
- msgstr "Opdater"
1794
-
1795
- #: templates/account/billing.php:39
1796
- msgid "Billing"
1797
- msgstr "Betaling"
1798
-
1799
- #: templates/account/billing.php44, templates/account/billing.php:44
1800
- msgid "Business name"
1801
- msgstr "Firmanavn"
1802
-
1803
- #: templates/account/billing.php45, templates/account/billing.php:45
1804
- msgid "Tax / VAT ID"
1805
- msgstr "Moms / VAT ID"
1806
-
1807
- #: templates/account/billing.php48, templates/account/billing.php48,
1808
- #: templates/account/billing.php49, templates/account/billing.php:49
1809
- msgid "Address Line %d"
1810
- msgstr "Adresselinje %d"
1811
-
1812
- #: templates/account/billing.php52, templates/account/billing.php:52
1813
- msgid "City"
1814
- msgstr "By"
1815
-
1816
- #: templates/account/billing.php52, templates/account/billing.php:52
1817
- msgid "Town"
1818
- msgstr "By"
1819
-
1820
- #: templates/account/billing.php53, templates/account/billing.php:53
1821
- msgid "ZIP / Postal Code"
1822
- msgstr "ZIP / Postnummer"
1823
-
1824
- #: templates/account/billing.php:308
1825
- msgid "Country"
1826
- msgstr "Land"
1827
-
1828
- #: templates/account/billing.php:310
1829
- msgid "Select Country"
1830
- msgstr "Vælg land"
1831
-
1832
- #: templates/account/billing.php317, templates/account/billing.php:318
1833
- msgid "State"
1834
- msgstr "Stat"
1835
-
1836
- #: templates/account/billing.php317, templates/account/billing.php:318
1837
- msgid "Province"
1838
- msgstr "Provins"
1839
-
1840
- #: templates/account/payments.php:29
1841
- msgid "Payments"
1842
- msgstr "Betalinger"
1843
-
1844
- #: templates/account/payments.php:36
1845
- msgid "Date"
1846
- msgstr "Dato"
1847
-
1848
- #: templates/account/payments.php:37
1849
- msgid "Amount"
1850
- msgstr "Beløb"
1851
-
1852
- #: templates/account/payments.php38, templates/account/payments.php:50
1853
- msgid "Invoice"
1854
- msgstr "Faktura"
1855
-
1856
- #: templates/debug/api-calls.php:56
1857
- msgid "API"
1858
- msgstr "API"
1859
-
1860
- #: templates/debug/api-calls.php:68
1861
- msgid "Method"
1862
- msgstr "Metode"
1863
-
1864
- #: templates/debug/api-calls.php:69
1865
- msgid "Code"
1866
- msgstr "Kode"
1867
-
1868
- #: templates/debug/api-calls.php:70
1869
- msgid "Length"
1870
- msgstr "Længde"
1871
-
1872
- #: templates/debug/api-calls.php:71
1873
- msgctxt "as file/folder path"
1874
- msgid "Path"
1875
- msgstr "Sti"
1876
-
1877
- #: templates/debug/api-calls.php:73
1878
- msgid "Body"
1879
- msgstr "Body"
1880
-
1881
- #: templates/debug/api-calls.php:75
1882
- msgid "Result"
1883
- msgstr "Resultat"
1884
-
1885
- #: templates/debug/api-calls.php:76
1886
- msgid "Start"
1887
- msgstr "Start"
1888
-
1889
- #: templates/debug/api-calls.php:77
1890
- msgid "End"
1891
- msgstr "Slut"
1892
-
1893
- #: templates/debug/logger.php:15
1894
- msgid "Log"
1895
- msgstr "Log"
1896
-
1897
- #. translators: %s: time period (e.g. In "2 hours")
1898
- #: templates/debug/plugins-themes-sync.php18,
1899
- #: templates/debug/scheduled-crons.php:91
1900
- msgid "In %s"
1901
- msgstr "Om %s"
1902
-
1903
- #. translators: %s: time period (e.g. "2 hours" ago)
1904
- #: templates/debug/plugins-themes-sync.php20,
1905
- #: templates/debug/scheduled-crons.php:93
1906
- msgid "%s ago"
1907
- msgstr "%s siden"
1908
-
1909
- #: templates/debug/plugins-themes-sync.php21,
1910
- #: templates/debug/scheduled-crons.php:74
1911
- msgctxt "seconds"
1912
- msgid "sec"
1913
- msgstr "sek"
1914
-
1915
- #: templates/debug/plugins-themes-sync.php:23
1916
- msgid "Plugins & Themes Sync"
1917
- msgstr "Synkronisering af plugins og temaer"
1918
-
1919
- #: templates/debug/plugins-themes-sync.php:28
1920
- msgid "Total"
1921
- msgstr "Total"
1922
-
1923
- #: templates/debug/plugins-themes-sync.php29,
1924
- #: templates/debug/scheduled-crons.php:84
1925
- msgid "Last"
1926
- msgstr "Sidste"
1927
-
1928
- #: templates/debug/scheduled-crons.php:76
1929
- msgid "Scheduled Crons"
1930
- msgstr "Planlagte cron jobs"
1931
-
1932
- #: templates/debug/scheduled-crons.php:81
1933
- msgid "Module"
1934
- msgstr "Modul"
1935
-
1936
- #: templates/debug/scheduled-crons.php:82
1937
- msgid "Module Type"
1938
- msgstr "Modultype"
1939
-
1940
- #: templates/debug/scheduled-crons.php:83
1941
- msgid "Cron Type"
1942
- msgstr "Cron Type"
1943
-
1944
- #: templates/debug/scheduled-crons.php:85
1945
- msgid "Next"
1946
- msgstr "Næste"
1947
-
1948
- #: templates/forms/affiliation.php:82
1949
- msgid "Non-expiring"
1950
- msgstr "Udløber ikke"
1951
-
1952
- #: templates/forms/affiliation.php:85
1953
- msgid "Apply to become an affiliate"
1954
- msgstr "Apply to become an affiliate"
1955
-
1956
- #: templates/forms/affiliation.php:104
1957
- msgid "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s."
1958
- msgstr "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s."
1959
-
1960
- #: templates/forms/affiliation.php:119
1961
- msgid "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information."
1962
- msgstr "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information."
1963
-
1964
- #: templates/forms/affiliation.php:122
1965
- msgid "Your affiliation account was temporarily suspended."
1966
- msgstr "Your affiliation account was temporarily suspended."
1967
-
1968
- #: templates/forms/affiliation.php:125
1969
- msgid "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days."
1970
- msgstr "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days."
1971
-
1972
- #: templates/forms/affiliation.php:128
1973
- msgid "Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support."
1974
- msgstr "Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support."
1975
-
1976
- #: templates/forms/affiliation.php:141
1977
- msgid "Like the %s? Become our ambassador and earn cash ;-)"
1978
- msgstr "Like the %s? Become our ambassador and earn cash ;-)"
1979
-
1980
- #: templates/forms/affiliation.php:142
1981
- msgid "Refer new customers to our %s and earn %s commission on each successful sale you refer!"
1982
- msgstr "Refer new customers to our %s and earn %s commission on each successful sale you refer!"
1983
-
1984
- #: templates/forms/affiliation.php:145
1985
- msgid "Program Summary"
1986
- msgstr "Program Summary"
1987
-
1988
- #: templates/forms/affiliation.php:147
1989
- msgid "%s commission when a customer purchases a new license."
1990
- msgstr "%s commission when a customer purchases a new license."
1991
-
1992
- #: templates/forms/affiliation.php:149
1993
- msgid "Get commission for automated subscription renewals."
1994
- msgstr "Get commission for automated subscription renewals."
1995
-
1996
- #: templates/forms/affiliation.php:152
1997
- msgid "%s tracking cookie after the first visit to maximize earnings potential."
1998
- msgstr "%s tracking cookie after the first visit to maximize earnings potential."
1999
-
2000
- #: templates/forms/affiliation.php:155
2001
- msgid "Unlimited commissions."
2002
- msgstr "Unlimited commissions."
2003
-
2004
- #: templates/forms/affiliation.php:157
2005
- msgid "%s minimum payout amount."
2006
- msgstr "%s minimum payout amount."
2007
-
2008
- #: templates/forms/affiliation.php:158
2009
- msgid "Payouts are in USD and processed monthly via PayPal."
2010
- msgstr "Payouts are in USD and processed monthly via PayPal."
2011
-
2012
- #: templates/forms/affiliation.php:159
2013
- msgid "As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days."
2014
- msgstr "As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days."
2015
-
2016
- #: templates/forms/affiliation.php:162
2017
- msgid "Affiliate"
2018
- msgstr "Affiliate"
2019
-
2020
- #: templates/forms/affiliation.php165, templates/forms/resend-key.php:23
2021
- msgid "Email address"
2022
- msgstr "E-mailadresse"
2023
-
2024
- #: templates/forms/affiliation.php:169
2025
- msgid "Full name"
2026
- msgstr "Fulde navn"
2027
-
2028
- #: templates/forms/affiliation.php:173
2029
- msgid "PayPal account email address"
2030
- msgstr "E-mailadresse til PayPal-konto"
2031
-
2032
- #: templates/forms/affiliation.php:177
2033
- msgid "Where are you going to promote the %s?"
2034
- msgstr "Where are you going to promote the %s?"
2035
-
2036
- #: templates/forms/affiliation.php:179
2037
- msgid "Enter the domain of your website or other websites from where you plan to promote the %s."
2038
- msgstr "Enter the domain of your website or other websites from where you plan to promote the %s."
2039
-
2040
- #: templates/forms/affiliation.php:181
2041
- msgid "Add another domain"
2042
- msgstr "Tilføj andet domæne"
2043
-
2044
- #: templates/forms/affiliation.php:185
2045
- msgid "Extra Domains"
2046
- msgstr "Ekstra domæner"
2047
-
2048
- #: templates/forms/affiliation.php:186
2049
- msgid "Extra domains where you will be marketing the product from."
2050
- msgstr "Extra domains where you will be marketing the product from."
2051
-
2052
- #: templates/forms/affiliation.php:196
2053
- msgid "Promotion methods"
2054
- msgstr "Promotion methods"
2055
-
2056
- #: templates/forms/affiliation.php:199
2057
- msgid "Social media (Facebook, Twitter, etc.)"
2058
- msgstr "Social media (Facebook, Twitter, etc.)"
2059
-
2060
- #: templates/forms/affiliation.php:203
2061
- msgid "Mobile apps"
2062
- msgstr "Mobile apps"
2063
-
2064
- #: templates/forms/affiliation.php:207
2065
- msgid "Website, email, and social media statistics (optional)"
2066
- msgstr "Website, email, and social media statistics (optional)"
2067
-
2068
- #: templates/forms/affiliation.php:210
2069
- msgid "Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential)."
2070
- msgstr "Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential)."
2071
-
2072
- #: templates/forms/affiliation.php:214
2073
- msgid "How will you promote us?"
2074
- msgstr "How will you promote us?"
2075
-
2076
- #: templates/forms/affiliation.php:217
2077
- msgid "Please provide details on how you intend to promote %s (please be as specific as possible)."
2078
- msgstr "Please provide details on how you intend to promote %s (please be as specific as possible)."
2079
-
2080
- #: templates/forms/affiliation.php223, templates/forms/resend-key.php:22
2081
- msgid "Cancel"
2082
- msgstr "Annuller"
2083
-
2084
- #: templates/forms/affiliation.php:225
2085
- msgid "Become an affiliate"
2086
- msgstr "Become an affiliate"
2087
-
2088
- #: templates/forms/license-activation.php:20
2089
- msgid "Please enter the license key that you received in the email right after the purchase:"
2090
- msgstr "Please enter the license key that you received in the email right after the purchase:"
2091
-
2092
- #: templates/forms/license-activation.php:25
2093
- msgid "Update License"
2094
- msgstr "Opdater licens"
2095
-
2096
- #: templates/forms/optout.php:30
2097
- msgctxt "verb"
2098
- msgid "Opt Out"
2099
- msgstr "Frameld"
2100
-
2101
- #: templates/forms/optout.php:31
2102
- msgctxt "verb"
2103
- msgid "Opt In"
2104
- msgstr "Tilmeld"
2105
-
2106
- #: templates/forms/optout.php:33
2107
- msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
2108
- msgstr "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
2109
-
2110
- #: templates/forms/optout.php:35
2111
- msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
2112
- msgstr "Ved at klikke \"Frameld\" vil vi ikke længere sende data fra %s til %s."
2113
-
2114
- #: templates/forms/premium-versions-upgrade-handler.php:24
2115
- msgid "There is a new version of %s available."
2116
- msgstr "There is a new version of %s available."
2117
-
2118
- #: templates/forms/premium-versions-upgrade-handler.php:25
2119
- msgid " %sRenew your license now%s to access version %s security & feature updates, and support."
2120
- msgstr " %sRenew your license now%s to access version %s security & feature updates, and support."
2121
-
2122
- #: templates/forms/premium-versions-upgrade-handler.php:34
2123
- msgid "New Version Available"
2124
- msgstr "New Version Available"
2125
-
2126
- #: templates/forms/premium-versions-upgrade-handler.php:36
2127
- msgid "Renew license"
2128
- msgstr "Renew license"
2129
-
2130
- #: templates/forms/premium-versions-upgrade-handler.php:53
2131
- msgctxt "close a window"
2132
- msgid "Dismiss"
2133
- msgstr "Fjern"
2134
-
2135
- #: templates/forms/resend-key.php:21
2136
- msgid "Send License Key"
2137
- msgstr "Send licensnøgle"
2138
-
2139
- #: templates/forms/resend-key.php:57
2140
- msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
2141
- msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
2142
-
2143
- #: templates/forms/trial-start.php:22
2144
- msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
2145
- msgstr "Du er 1 klik fra at begynde din %1$s dages gratis prøveperiode af planen %2$s."
2146
-
2147
- #: templates/forms/trial-start.php:28
2148
- msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial."
2149
- msgstr "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial."
2150
-
2151
- #: templates/js/style-premium-theme.php:37
2152
- msgid "Premium"
2153
- msgstr "Premium"
2154
-
2155
- #: templates/partials/network-activation.php:23
2156
- msgid "Activate license on all sites in the network."
2157
- msgstr "Activate license on all sites in the network."
2158
-
2159
- #: templates/partials/network-activation.php:24
2160
- msgid "Apply on all sites in the network."
2161
- msgstr "Apply on all sites in the network."
2162
-
2163
- #: templates/partials/network-activation.php:27
2164
- msgid "Activate license on all pending sites."
2165
- msgstr "Activate license on all pending sites."
2166
-
2167
- #: templates/partials/network-activation.php:28
2168
- msgid "Apply on all pending sites."
2169
- msgstr "Apply on all pending sites."
2170
-
2171
- #: templates/partials/network-activation.php36,
2172
- #: templates/partials/network-activation.php:68
2173
- msgid "allow"
2174
- msgstr "allow"
2175
-
2176
- #: templates/partials/network-activation.php38,
2177
- #: templates/partials/network-activation.php:70
2178
- msgid "delegate"
2179
- msgstr "delegate"
2180
-
2181
- #: templates/partials/network-activation.php41,
2182
- #: templates/partials/network-activation.php:73
2183
- msgid "skip"
2184
- msgstr "skip"
2185
-
2186
- #: templates/plugin-info/description.php72,
2187
- #: templates/plugin-info/screenshots.php:31
2188
- msgid "Click to view full-size screenshot %d"
2189
- msgstr "Click to view full-size screenshot %d"
2190
-
2191
- #: templates/plugin-info/features.php:56
2192
- msgid "Unlimited Updates"
2193
- msgstr "Ubegrænsede opdateringer"
2194
-
2195
- #: templates/account/partials/activate-license-button.php:46
2196
- msgid "Localhost"
2197
- msgstr "Localhost"
2198
-
2199
- #: templates/account/partials/activate-license-button.php:50
2200
- msgctxt "as 5 licenses left"
2201
- msgid "%s left"
2202
- msgstr "%s tilbage"
2203
-
2204
- #: templates/account/partials/activate-license-button.php:51
2205
- msgid "Last license"
2206
- msgstr "Seneste license"
2207
-
2208
- #: templates/account/partials/addon.php:111
2209
- msgid "Cancelled"
2210
- msgstr "Annulleret"
2211
-
2212
- #: templates/account/partials/addon.php:116
2213
- msgid "Expired"
2214
- msgstr "Udløbet"
2215
-
2216
- #: templates/account/partials/addon.php:121
2217
- msgid "No expiration"
2218
- msgstr "Udløber ikke"
2219
-
2220
- #: templates/account/partials/addon.php259,
2221
- #: templates/account/partials/addon.php:312
2222
- msgid "Activate this add-on"
2223
- msgstr "Aktiver denne tilføjelse"
2224
-
2225
- #: templates/account/partials/site.php:181
2226
- msgid "Owner Name"
2227
- msgstr "Owner Name"
2228
-
2229
- #: templates/account/partials/site.php:193
2230
- msgid "Owner Email"
2231
- msgstr "Owner Email"
2232
-
2233
- #: templates/account/partials/site.php:205
2234
- msgid "Owner ID"
2235
- msgstr "Owner ID"
2236
-
2237
- #: templates/account/partials/site.php:270
2238
- msgid "Subscription"
2239
- msgstr "Subscription"
2240
-
2241
- #: templates/forms/deactivation/contact.php:19
2242
- msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
2243
- msgstr "Vi beklager ulejligheden, og vi er her for at hjælpe, hvis du giver os chancen."
2244
-
2245
- #: templates/forms/deactivation/contact.php:22
2246
- msgid "Contact Support"
2247
- msgstr "Kontakt support"
2248
-
2249
- #: templates/forms/deactivation/form.php:56
2250
- msgid "Anonymous feedback"
2251
- msgstr "Anonym feedback"
2252
-
2253
- #: templates/forms/deactivation/form.php:63
2254
- msgid "Deactivate"
2255
- msgstr "Deaktiver"
2256
-
2257
- #: templates/forms/deactivation/form.php:65
2258
- msgid "Activate %s"
2259
- msgstr "Aktiver %s"
2260
-
2261
- #: templates/forms/deactivation/form.php:76
2262
- msgid "Quick feedback"
2263
- msgstr "Hurtig feedback"
2264
-
2265
- #: templates/forms/deactivation/form.php:80
2266
- msgid "If you have a moment, please let us know why you are %s"
2267
- msgstr "Hvis du har tid, så lad os venligst vide hvorfor du %s"
2268
-
2269
- #: templates/forms/deactivation/form.php:80
2270
- msgid "deactivating"
2271
- msgstr "deaktiverer"
2272
-
2273
- #: templates/forms/deactivation/form.php:80
2274
- msgid "switching"
2275
- msgstr "skifter"
2276
-
2277
- #: templates/forms/deactivation/form.php:269
2278
- msgid "Submit & %s"
2279
- msgstr "Send & %s"
2280
-
2281
- #: templates/forms/deactivation/form.php:290
2282
- msgid "Kindly tell us the reason so we can improve."
2283
- msgstr "Fortæl os venligst årsagen, så vi kan forbedre det."
2284
-
2285
- #: templates/forms/deactivation/form.php:411
2286
- msgid "Yes - %s"
2287
- msgstr "Ja - %s"
2288
-
2289
- #: templates/forms/deactivation/form.php:418
2290
- msgid "Skip & %s"
2291
- msgstr "Spring over & %s"
2292
-
2293
- #: templates/forms/deactivation/retry-skip.php:21
2294
- msgid "Click here to use the plugin anonymously"
2295
- msgstr "Klik her for at benytte pluginnet anonymt"
2296
-
2297
- #: templates/forms/deactivation/retry-skip.php:23
2298
- msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
2299
- msgstr "You might have missed it, but you don't have to share any data and can just %s the opt-in."
1
+ # Copyright (C) 2019 freemius
2
+ # This file is distributed under the same license as the freemius package.
3
+ # Translators:
4
+ # Joachim Jensen, 2016-2018
5
+ # Lars Koudal, 2018
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: WordPress SDK\n"
9
+ "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
10
+ "POT-Creation-Date: \n"
11
+ "PO-Revision-Date: 2018-11-25 07:22+0000\n"
12
+ "Last-Translator: Vova Feldman <vova@freemius.com>\n"
13
+ "Language: da_DK\n"
14
+ "Language-Team: Danish (Denmark) (http://www.transifex.com/freemius/wordpress-sdk/language/da_DK/)\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "MIME-Version: 1.0\n"
19
+ "X-Poedit-Basepath: ..\n"
20
+ "X-Poedit-KeywordsList: get_text_inline;fs_text_inline;fs_echo_inline;fs_esc_js_inline;fs_esc_attr_inline;fs_esc_attr_echo_inline;fs_esc_html_inline;fs_esc_html_echo_inline;get_text_x_inline:1,2c;fs_text_x_inline:1,2c;fs_echo_x_inline:1,2c;fs_esc_attr_x_inline:1,2c;fs_esc_js_x_inline:1,2c;fs_esc_js_echo_x_inline:1,2c;fs_esc_html_x_inline:1,2c;fs_esc_html_echo_x_inline:1,2c\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
23
+ "X-Poedit-SourceCharset: UTF-8\n"
24
+
25
+ #: includes/class-freemius.php:1688
26
+ msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
27
+ msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
28
+
29
+ #: includes/class-freemius.php:1690
30
+ msgid "Error"
31
+ msgstr "Fejl"
32
+
33
+ #: includes/class-freemius.php:2011
34
+ msgid "I found a better %s"
35
+ msgstr "Jeg fandt et bedre %s"
36
+
37
+ #: includes/class-freemius.php:2013
38
+ msgid "What's the %s's name?"
39
+ msgstr "Hvad er navnet på %s?"
40
+
41
+ #: includes/class-freemius.php:2019
42
+ msgid "It's a temporary %s. I'm just debugging an issue."
43
+ msgstr "Det er en midlertidig %s. Jeg er i gang med fejlrettelser."
44
+
45
+ #: includes/class-freemius.php:2021
46
+ msgid "Deactivation"
47
+ msgstr "Deaktivering"
48
+
49
+ #: includes/class-freemius.php:2022
50
+ msgid "Theme Switch"
51
+ msgstr "Temaskift"
52
+
53
+ #: includes/class-freemius.php2031, templates/forms/resend-key.php:24
54
+ msgid "Other"
55
+ msgstr "Andet"
56
+
57
+ #: includes/class-freemius.php:2039
58
+ msgid "I no longer need the %s"
59
+ msgstr "Jeg har ikke længere brug for %s"
60
+
61
+ #: includes/class-freemius.php:2046
62
+ msgid "I only needed the %s for a short period"
63
+ msgstr "Jeg behøvede kun %s i en kort periode"
64
+
65
+ #: includes/class-freemius.php:2052
66
+ msgid "The %s broke my site"
67
+ msgstr "%s ødelagde min webside"
68
+
69
+ #: includes/class-freemius.php:2059
70
+ msgid "The %s suddenly stopped working"
71
+ msgstr "%s stoppede pludseligt med at virke"
72
+
73
+ #: includes/class-freemius.php:2069
74
+ msgid "I can't pay for it anymore"
75
+ msgstr "Jeg kan ikke længere betale for det"
76
+
77
+ #: includes/class-freemius.php:2071
78
+ msgid "What price would you feel comfortable paying?"
79
+ msgstr "Hvilken pris ville du foretrække at betale?"
80
+
81
+ #: includes/class-freemius.php:2077
82
+ msgid "I don't like to share my information with you"
83
+ msgstr "Jeg har ikke lyst til at dele mine informationer med jer"
84
+
85
+ #: includes/class-freemius.php:2098
86
+ msgid "The %s didn't work"
87
+ msgstr "%s virkede ikke"
88
+
89
+ #: includes/class-freemius.php:2108
90
+ msgid "I couldn't understand how to make it work"
91
+ msgstr "Jeg forstod ikke, hvordan jeg skulle få det til at fungere."
92
+
93
+ #: includes/class-freemius.php:2116
94
+ msgid "The %s is great, but I need specific feature that you don't support"
95
+ msgstr "%s er godt, men jeg har brug for en specifik feature, som ikke understøttes"
96
+
97
+ #: includes/class-freemius.php:2118
98
+ msgid "What feature?"
99
+ msgstr "Hvilken feature?"
100
+
101
+ #: includes/class-freemius.php:2122
102
+ msgid "The %s is not working"
103
+ msgstr "%s virker ikke"
104
+
105
+ #: includes/class-freemius.php:2124
106
+ msgid "Kindly share what didn't work so we can fix it for future users..."
107
+ msgstr "Kindly share what didn't work so we can fix it for future users..."
108
+
109
+ #: includes/class-freemius.php:2128
110
+ msgid "It's not what I was looking for"
111
+ msgstr "Det er ikke, hvad jeg søgte"
112
+
113
+ #: includes/class-freemius.php:2130
114
+ msgid "What you've been looking for?"
115
+ msgstr "Hvad har du ledt efter?"
116
+
117
+ #: includes/class-freemius.php:2134
118
+ msgid "The %s didn't work as expected"
119
+ msgstr "%s virkede ikke som forventet"
120
+
121
+ #: includes/class-freemius.php:2136
122
+ msgid "What did you expect?"
123
+ msgstr "Hvad forventede du?"
124
+
125
+ #: includes/class-freemius.php2942, templates/debug.php:20
126
+ msgid "Freemius Debug"
127
+ msgstr "Freemius Debug"
128
+
129
+ #: includes/class-freemius.php:3670
130
+ msgid "I don't know what is cURL or how to install it, help me!"
131
+ msgstr "Jeg ved ikke hvad cURL er, eller hvordan jeg installerer det. Hjælp mig!"
132
+
133
+ #: includes/class-freemius.php:3672
134
+ msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
135
+ msgstr "Vi vil kontakte din udbyder og løse problemet. Når vi har opdatinger i sagen, vil vi følge op med en email til dig på %s."
136
+
137
+ #: includes/class-freemius.php:3679
138
+ msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
139
+ msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
140
+
141
+ #: includes/class-freemius.php:3784
142
+ msgid "Yes - do your thing"
143
+ msgstr "Ja - fortsæt bare"
144
+
145
+ #: includes/class-freemius.php:3789
146
+ msgid "No - just deactivate"
147
+ msgstr "Nej - bare deaktiver"
148
+
149
+ #: includes/class-freemius.php3834, includes/class-freemius.php4343,
150
+ #: includes/class-freemius.php5442, includes/class-freemius.php11545,
151
+ #: includes/class-freemius.php14916, includes/class-freemius.php14968,
152
+ #: includes/class-freemius.php15030, includes/class-freemius.php17263,
153
+ #: includes/class-freemius.php17273, includes/class-freemius.php17882,
154
+ #: includes/class-freemius.php18742, includes/class-freemius.php18857,
155
+ #: includes/class-freemius.php19001, templates/add-ons.php:43
156
+ msgctxt "exclamation"
157
+ msgid "Oops"
158
+ msgstr "Ups"
159
+
160
+ #: includes/class-freemius.php:3903
161
+ msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
162
+ msgstr "Tak fordi du giver os en chance for at fixe det! En besked er lige blevet sendt til vores tekniske personale. Vi vil vende tilbage, så snart der er nyt om %s. Vi sætter pris på din tålmodighed."
163
+
164
+ #: includes/class-freemius.php:4340
165
+ msgctxt "addonX cannot run without pluginY"
166
+ msgid "%s cannot run without %s."
167
+ msgstr "%s virker ikke uden %s."