Version Description
Download this release
Release Info
Developer | creativethemeshq |
Plugin | Blocksy Companion |
Version | 1.7.62 |
Comparing to | |
See all releases |
Code changes from version 1.7.61 to 1.7.62
- blocksy-companion.php +1 -1
- framework/extensions/cookies-consent/static/bundle/main.css +1 -1
- framework/extensions/mailchimp/static/bundle/main.css +1 -1
- framework/extensions/product-reviews/static/bundle/main-admin.css +1 -1
- framework/extensions/product-reviews/static/bundle/main.css +1 -1
- framework/extensions/widgets/static/bundle/main.css +1 -1
- readme.txt +4 -1
- static/bundle/dashboard.css +1 -1
- static/bundle/options.css +1 -1
- trunk/LICENSE.txt +339 -0
- trunk/blocksy-companion.php +131 -0
- trunk/framework/autoload.php +135 -0
- trunk/framework/cache-reset-manager.php +175 -0
- trunk/framework/cli.php +82 -0
- trunk/framework/dashboard.php +149 -0
- trunk/framework/extensions-manager-api.php +101 -0
- trunk/framework/extensions-manager.php +338 -0
- trunk/framework/extensions/cookies-consent/config.php +6 -0
- trunk/framework/extensions/cookies-consent/customizer.php +224 -0
- trunk/framework/extensions/cookies-consent/extension.php +93 -0
- trunk/framework/extensions/cookies-consent/global.php +66 -0
- trunk/framework/extensions/cookies-consent/helpers.php +93 -0
- trunk/framework/extensions/cookies-consent/readme.php +38 -0
- trunk/framework/extensions/cookies-consent/static/bundle/main.css +8 -0
- trunk/framework/extensions/cookies-consent/static/bundle/main.js +8 -0
- trunk/framework/extensions/cookies-consent/static/bundle/sync.js +1 -0
- trunk/framework/extensions/cookies-consent/static/images/type-1.svg +37 -0
- trunk/framework/extensions/cookies-consent/static/images/type-2.svg +34 -0
- trunk/framework/extensions/cookies-consent/static/js/ct-events.js +270 -0
- trunk/framework/extensions/cookies-consent/static/js/lazy-load-helpers.js +20 -0
- trunk/framework/extensions/cookies-consent/static/js/main.js +87 -0
- trunk/framework/extensions/cookies-consent/static/js/sync.js +65 -0
- trunk/framework/extensions/cookies-consent/static/js/sync/helpers.js +145 -0
- trunk/framework/extensions/cookies-consent/static/js/variables.js +43 -0
- trunk/framework/extensions/cookies-consent/static/sass/main.scss +173 -0
- trunk/framework/extensions/mailchimp/admin-static/bundle/1.2c9ebf0a36c6c732fee6.js +14 -0
- trunk/framework/extensions/mailchimp/admin-static/bundle/2.976c8f43abfe584b1a9d.js +1 -0
- trunk/framework/extensions/mailchimp/admin-static/bundle/main.js +1 -0
- trunk/framework/extensions/mailchimp/admin-static/bundle/sync.js +1 -0
- trunk/framework/extensions/mailchimp/admin-static/js/ListPicker.js +22 -0
- trunk/framework/extensions/mailchimp/admin-static/js/ListPicker/Implementation.js +124 -0
- trunk/framework/extensions/mailchimp/admin-static/js/main.js +10 -0
- trunk/framework/extensions/mailchimp/admin-static/js/public-path.js +1 -0
- trunk/framework/extensions/mailchimp/admin-static/js/sync.js +78 -0
- trunk/framework/extensions/mailchimp/admin-static/js/variables.js +52 -0
- trunk/framework/extensions/mailchimp/config.php +7 -0
- trunk/framework/extensions/mailchimp/ct-mailchimp/options.php +125 -0
- trunk/framework/extensions/mailchimp/ct-mailchimp/view.php +109 -0
- trunk/framework/extensions/mailchimp/ct-mailchimp/widget.php +22 -0
- trunk/framework/extensions/mailchimp/customizer.php +270 -0
- trunk/framework/extensions/mailchimp/dashboard-static/bundle/main.js +14 -0
- trunk/framework/extensions/mailchimp/dashboard-static/js/EditCredentials.js +157 -0
- trunk/framework/extensions/mailchimp/dashboard-static/js/ListPicker.js +149 -0
- trunk/framework/extensions/mailchimp/dashboard-static/js/Mailchimp.js +95 -0
- trunk/framework/extensions/mailchimp/dashboard-static/js/hooks/useActivationWithRequirements.js +80 -0
- trunk/framework/extensions/mailchimp/dashboard-static/js/main.js +15 -0
- trunk/framework/extensions/mailchimp/extension.php +144 -0
- trunk/framework/extensions/mailchimp/global.php +103 -0
- trunk/framework/extensions/mailchimp/helpers.php +140 -0
- trunk/framework/extensions/mailchimp/mailchimp-manager.php +147 -0
- trunk/framework/extensions/mailchimp/pre-boot.php +111 -0
- trunk/framework/extensions/mailchimp/readme.php +37 -0
- trunk/framework/extensions/mailchimp/static/bundle/main.css +8 -0
- trunk/framework/extensions/mailchimp/static/bundle/main.js +1 -0
- trunk/framework/extensions/mailchimp/static/js/main.js +82 -0
- trunk/framework/extensions/mailchimp/static/sass/main.scss +40 -0
- trunk/framework/extensions/mailchimp/static/sass/single-block.scss +70 -0
- trunk/framework/extensions/mailchimp/static/sass/widget.scss +39 -0
- trunk/framework/extensions/product-reviews/config.php +12 -0
- trunk/framework/extensions/product-reviews/extension.php +316 -0
- trunk/framework/extensions/product-reviews/helpers.php +39 -0
- trunk/framework/extensions/product-reviews/metabox.php +198 -0
- trunk/framework/extensions/product-reviews/pre-boot.php +65 -0
- trunk/framework/extensions/product-reviews/static/bundle/dashboard.js +6 -0
- trunk/framework/extensions/product-reviews/static/bundle/main-admin.css +8 -0
- trunk/framework/extensions/product-reviews/static/bundle/main.css +8 -0
- trunk/framework/extensions/product-reviews/static/js/EditSettings.js +141 -0
- trunk/framework/extensions/product-reviews/static/js/ProductReviews.js +100 -0
- trunk/framework/extensions/product-reviews/static/js/dashboard.js +10 -0
- trunk/framework/extensions/product-reviews/static/sass/actions.scss +18 -0
- trunk/framework/extensions/product-reviews/static/sass/description.scss +5 -0
- trunk/framework/extensions/product-reviews/static/sass/main-admin.scss +8 -0
- trunk/framework/extensions/product-reviews/static/sass/main.scss +23 -0
- trunk/framework/extensions/product-reviews/static/sass/quick-info.scss +32 -0
- trunk/framework/extensions/product-reviews/static/sass/scores.scss +83 -0
- trunk/framework/extensions/product-reviews/static/sass/slider.scss +36 -0
- trunk/framework/extensions/product-reviews/static/sass/title.scss +6 -0
- trunk/framework/extensions/product-reviews/views/single-top.php +243 -0
- trunk/framework/extensions/trending/config.php +6 -0
- trunk/framework/extensions/trending/customizer.php +193 -0
- trunk/framework/extensions/trending/extension.php +76 -0
- trunk/framework/extensions/trending/global.php +53 -0
- trunk/framework/extensions/trending/helpers.php +195 -0
- trunk/framework/extensions/trending/static/bundle/main.js +1 -0
- trunk/framework/extensions/trending/static/bundle/sync.js +1 -0
- trunk/framework/extensions/trending/static/js/main.js +17 -0
- trunk/framework/extensions/trending/static/js/sync.js +42 -0
- trunk/framework/extensions/trending/static/js/trending-block.js +139 -0
- trunk/framework/extensions/widgets/config.php +5 -0
- trunk/framework/extensions/widgets/extension.php +36 -0
- trunk/framework/extensions/widgets/static/bundle/main.css +8 -0
- trunk/framework/extensions/widgets/static/sass/about-me.scss +67 -0
- trunk/framework/extensions/widgets/static/sass/facebook.scss +37 -0
- trunk/framework/extensions/widgets/static/sass/main.scss +7 -0
- trunk/framework/extensions/widgets/static/sass/posts.scss +132 -0
- trunk/framework/extensions/widgets/static/sass/quote.scss +39 -0
- trunk/framework/extensions/widgets/static/sass/social-icons.scss +23 -0
- trunk/framework/extensions/widgets/widgets/ct-about-me/helpers.php +18 -0
- trunk/framework/extensions/widgets/widgets/ct-about-me/options.php +235 -0
- trunk/framework/extensions/widgets/widgets/ct-about-me/view.php +139 -0
- trunk/framework/extensions/widgets/widgets/ct-about-me/widget.php +22 -0
- trunk/framework/extensions/widgets/widgets/ct-advertisement/options.php +84 -0
- trunk/framework/extensions/widgets/widgets/ct-advertisement/view.php +61 -0
- trunk/framework/extensions/widgets/widgets/ct-advertisement/widget.php +22 -0
- trunk/framework/extensions/widgets/widgets/ct-contact-info/options.php +312 -0
- trunk/framework/extensions/widgets/widgets/ct-contact-info/view.php +70 -0
- trunk/framework/extensions/widgets/widgets/ct-contact-info/widget.php +22 -0
- trunk/framework/extensions/widgets/widgets/ct-facebook/options.php +52 -0
- trunk/framework/extensions/widgets/widgets/ct-facebook/view.php +61 -0
- trunk/framework/extensions/widgets/widgets/ct-facebook/widget.php +22 -0
- trunk/framework/extensions/widgets/widgets/ct-posts/options.php +329 -0
- trunk/framework/extensions/widgets/widgets/ct-posts/view.php +224 -0
- trunk/framework/extensions/widgets/widgets/ct-posts/widget.php +23 -0
- trunk/framework/extensions/widgets/widgets/ct-quote/options.php +55 -0
- trunk/framework/extensions/widgets/widgets/ct-quote/view.php +57 -0
- trunk/framework/extensions/widgets/widgets/ct-quote/widget.php +22 -0
- trunk/framework/extensions/widgets/widgets/ct-socials/options.php +106 -0
- trunk/framework/extensions/widgets/widgets/ct-socials/view.php +53 -0
- trunk/framework/extensions/widgets/widgets/ct-socials/widget.php +23 -0
- trunk/framework/features/conditions-manager.php +487 -0
- trunk/framework/features/customizer-options-manager.php +206 -0
- trunk/framework/features/demo-install.php +340 -0
- trunk/framework/features/demo-install/child-theme.php +121 -0
- trunk/framework/features/demo-install/content-eraser.php +179 -0
- trunk/framework/features/demo-install/content-export.php +663 -0
- trunk/framework/features/demo-install/content-installer.php +416 -0
- trunk/framework/features/demo-install/fake-content-eraser.php +273 -0
- trunk/framework/features/demo-install/install-finish.php +194 -0
- trunk/framework/features/demo-install/options-export.php +123 -0
- trunk/framework/features/demo-install/options-import.php +400 -0
- trunk/framework/features/demo-install/parsers.php +701 -0
- trunk/framework/features/demo-install/plugins-uninstaller.php +44 -0
- trunk/framework/features/demo-install/required-plugins.php +85 -0
- trunk/framework/features/demo-install/widgets-export.php +67 -0
- trunk/framework/features/demo-install/widgets-import.php +277 -0
- trunk/framework/features/demo-install/wp-importer.php +1348 -0
- trunk/framework/features/dynamic-css.php +270 -0
- trunk/framework/features/google-analytics.php +110 -0
- trunk/framework/features/header.php +542 -0
- trunk/framework/features/header/account-modal.php +139 -0
- trunk/framework/features/header/header-options.php +178 -0
- trunk/framework/features/header/items/account/config.php +25 -0
- trunk/framework/features/header/items/account/dynamic-styles.php +460 -0
- trunk/framework/features/header/items/account/options.php +946 -0
- trunk/framework/features/header/items/account/sync.js +336 -0
- trunk/framework/features/header/items/account/view.php +56 -0
- trunk/framework/features/header/items/account/views/login.php +97 -0
- trunk/framework/features/header/items/account/views/logout.php +53 -0
- trunk/framework/features/opengraph-meta-data.php +224 -0
- trunk/framework/helpers/blocksy-integration.php +177 -0
- trunk/framework/helpers/helpers.php +102 -0
- trunk/framework/theme-integration.php +356 -0
- trunk/framework/views/blocksy-posts.php +156 -0
- trunk/framework/views/optin.php +6 -0
- trunk/framework/widgets-manager.php +201 -0
- trunk/freemius-pricing/178afa6030e76635dbe835e111d2c507.png +0 -0
- trunk/freemius-pricing/27b5a722a5553d9de0170325267fccec.png +0 -0
- trunk/freemius-pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png +0 -0
- trunk/freemius-pricing/5480ed23b199531a8cbc05924f26952b.png +0 -0
- trunk/freemius-pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg +402 -0
- trunk/freemius-pricing/c03f665db27af43971565560adfba594.png +0 -0
- trunk/freemius-pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png +0 -0
- trunk/freemius-pricing/dd89563360f0272635c8f0ab7d7f1402.png +0 -0
- trunk/freemius-pricing/e366d70661d8ad2493bd6afbd779f125.png +0 -0
- trunk/freemius-pricing/f3aac72a8e63997d6bb888f816457e9b.png +0 -0
- trunk/freemius-pricing/f928f1be99776af83e8e6be4baf8ffe7.svg +227 -0
- trunk/freemius-pricing/fde48e4609a6ddc11d639fc2421f2afd.png +0 -0
- trunk/freemius-pricing/freemius-pricing.js +8914 -0
blocksy-companion.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
Plugin Name: Blocksy Companion
|
5 |
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
6 |
-
Version: 1.7.
|
7 |
Author: CreativeThemes
|
8 |
Author URI: https://creativethemes.com
|
9 |
Text Domain: blc
|
3 |
/*
|
4 |
Plugin Name: Blocksy Companion
|
5 |
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
6 |
+
Version: 1.7.62
|
7 |
Author: CreativeThemes
|
8 |
Author URI: https://creativethemes.com
|
9 |
Text Domain: blc
|
framework/extensions/cookies-consent/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/mailchimp/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/product-reviews/static/bundle/main-admin.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/product-reviews/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
framework/extensions/widgets/static/bundle/main.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Requires PHP: 7.0
|
|
5 |
Tested up to: 5.6
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
-
Stable tag: 1.7.
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -23,6 +23,9 @@ It runs and adds its enhancements only if the Blocksy theme is installed and act
|
|
23 |
2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
|
24 |
|
25 |
== Changelog ==
|
|
|
|
|
|
|
26 |
1.7.61: 2021-02-23
|
27 |
- Fix: Dashboard JavaScript fixes
|
28 |
|
5 |
Tested up to: 5.6
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
Stable tag: 1.7.62
|
9 |
|
10 |
== Description ==
|
11 |
|
23 |
2. Activate the plugin by going to **Plugins** page in WordPress admin and clicking on **Activate** link.
|
24 |
|
25 |
== Changelog ==
|
26 |
+
1.7.62: 2021-02-23
|
27 |
+
- Fix: Dashboard JavaScript fixes
|
28 |
+
|
29 |
1.7.61: 2021-02-23
|
30 |
- Fix: Dashboard JavaScript fixes
|
31 |
|
static/bundle/dashboard.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
static/bundle/options.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/**
|
2 |
-
* - v1.7.
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
1 |
/**
|
2 |
+
* - v1.7.62
|
3 |
*
|
4 |
* Copyright (c) 2021
|
5 |
* Licensed GPLv2+
|
trunk/LICENSE.txt
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 origina
|
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
|
trunk/blocksy-companion.php
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Plugin Name: Blocksy Companion
|
5 |
+
Description: This plugin is the companion for the Blocksy theme, it runs and adds its enhacements only if the Blocksy theme is installed and active.
|
6 |
+
Version: 1.7.62
|
7 |
+
Author: CreativeThemes
|
8 |
+
Author URI: https://creativethemes.com
|
9 |
+
Text Domain: blc
|
10 |
+
Domain Path: /languages/
|
11 |
+
License: GPLv2 or later
|
12 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
+
*/
|
14 |
+
|
15 |
+
if ( !defined( 'ABSPATH' ) ) {
|
16 |
+
exit;
|
17 |
+
// Exit if accessed directly.
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
if ( function_exists( 'blc_fs' ) ) {
|
22 |
+
blc_fs()->set_basename( false, __FILE__ );
|
23 |
+
} else {
|
24 |
+
|
25 |
+
if ( !function_exists( 'blc_fs' ) ) {
|
26 |
+
global $blc_fs ;
|
27 |
+
|
28 |
+
if ( !isset( $blc_fs ) ) {
|
29 |
+
if ( !defined( 'WP_FS__PRODUCT_5115_MULTISITE' ) ) {
|
30 |
+
define( 'WP_FS__PRODUCT_5115_MULTISITE', true );
|
31 |
+
}
|
32 |
+
require_once dirname( __FILE__ ) . '/freemius/start.php';
|
33 |
+
$has_account = true;
|
34 |
+
$instance = \Freemius::instance( 5115, 'blocksy-companion', true );
|
35 |
+
|
36 |
+
if ( in_array( 'white-label', get_option( 'blocksy_active_extensions', [] ) ) && $instance->is_plan( 'agency' ) ) {
|
37 |
+
$settings = get_option( 'blocksy_ext_white_label_settings', [] );
|
38 |
+
if ( $settings && isset( $settings['hide_billing_account'] ) && $settings['hide_billing_account'] ) {
|
39 |
+
$has_account = false;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
$blc_fs = fs_dynamic_init( array(
|
44 |
+
'id' => '5115',
|
45 |
+
'slug' => 'blocksy-companion',
|
46 |
+
'premium_slug' => 'blocksy-companion-pro',
|
47 |
+
'type' => 'plugin',
|
48 |
+
'public_key' => 'pk_b00a5cbae90b2e948015a7d0710f5',
|
49 |
+
'premium_suffix' => 'PRO',
|
50 |
+
'is_premium' => false,
|
51 |
+
'has_addons' => false,
|
52 |
+
'has_paid_plans' => true,
|
53 |
+
'menu' => ( true ? [
|
54 |
+
'slug' => 'ct-dashboard',
|
55 |
+
'support' => false,
|
56 |
+
'contact' => false,
|
57 |
+
'pricing' => true,
|
58 |
+
'account' => $has_account,
|
59 |
+
] : [
|
60 |
+
'support' => false,
|
61 |
+
'contact' => false,
|
62 |
+
'pricing' => false,
|
63 |
+
'account' => false,
|
64 |
+
] ),
|
65 |
+
'is_live' => true,
|
66 |
+
) );
|
67 |
+
function blc_fs()
|
68 |
+
{
|
69 |
+
global $blc_fs ;
|
70 |
+
return $blc_fs;
|
71 |
+
}
|
72 |
+
|
73 |
+
blc_fs();
|
74 |
+
do_action( 'blc_fs_loaded' );
|
75 |
+
blc_fs()->add_filter( 'freemius_pricing_js_path', function ( $d ) {
|
76 |
+
// return BLOCKSY_PATH . 'freemius-pricing/freemius-pricing.js';
|
77 |
+
// Only in DEV!!
|
78 |
+
return WP_CONTENT_DIR . '/plugins/blocksy-companion/freemius-pricing/freemius-pricing.js';
|
79 |
+
} );
|
80 |
+
}
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
define( 'BLOCKSY__FILE__', __FILE__ );
|
85 |
+
define( 'BLOCKSY_PLUGIN_BASE', plugin_basename( BLOCKSY__FILE__ ) );
|
86 |
+
define( 'BLOCKSY_PATH', plugin_dir_path( BLOCKSY__FILE__ ) );
|
87 |
+
define( 'BLOCKSY_URL', plugin_dir_url( BLOCKSY__FILE__ ) );
|
88 |
+
add_action( 'init', function () {
|
89 |
+
/**
|
90 |
+
* Load Blocksy textdomain.
|
91 |
+
*
|
92 |
+
* Load gettext translate for Blocksy text domain.
|
93 |
+
*/
|
94 |
+
load_plugin_textdomain( 'blc', false, dirname( BLOCKSY_PLUGIN_BASE ) . '/languages' );
|
95 |
+
} );
|
96 |
+
|
97 |
+
if ( !version_compare( PHP_VERSION, '7.0', '>=' ) ) {
|
98 |
+
add_action( 'admin_notices', 'blc_fail_php_version' );
|
99 |
+
} elseif ( !version_compare( get_bloginfo( 'version' ), '5.0', '>=' ) ) {
|
100 |
+
add_action( 'admin_notices', 'blc_fail_wp_version' );
|
101 |
+
} else {
|
102 |
+
require BLOCKSY_PATH . 'plugin.php';
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Blocksy admin notice for minimum PHP version.
|
107 |
+
*
|
108 |
+
* Warning when the site doesn't have the minimum required PHP version.
|
109 |
+
*/
|
110 |
+
function blc_fail_php_version()
|
111 |
+
{
|
112 |
+
/* translators: %s: PHP version */
|
113 |
+
$message = sprintf( esc_html__( 'Blocksy requires PHP version %s+, plugin is currently NOT RUNNING.', 'blc' ), '7.0' );
|
114 |
+
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
115 |
+
echo wp_kses_post( $html_message ) ;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Blocksy admin notice for minimum WordPress version.
|
120 |
+
*
|
121 |
+
* Warning when the site doesn't have the minimum required WordPress version.
|
122 |
+
*/
|
123 |
+
function blc_fail_wp_version()
|
124 |
+
{
|
125 |
+
/* translators: %s: WordPress version */
|
126 |
+
$message = sprintf( esc_html__( 'Blocksy requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'blc' ), '5.0' );
|
127 |
+
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
128 |
+
echo wp_kses_post( $html_message ) ;
|
129 |
+
}
|
130 |
+
|
131 |
+
}
|
trunk/framework/autoload.php
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Blocksy;
|
4 |
+
|
5 |
+
if (! defined('ABSPATH')) {
|
6 |
+
exit; // Exit if accessed directly.
|
7 |
+
}
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Blocksy autoloader.
|
11 |
+
*/
|
12 |
+
class Autoloader {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Classes map.
|
16 |
+
*
|
17 |
+
* Maps Blocksy classes to file names.
|
18 |
+
*
|
19 |
+
* @static
|
20 |
+
*
|
21 |
+
* @var array Classes used by blocksy.
|
22 |
+
*/
|
23 |
+
private static function get_classes_map() {
|
24 |
+
return apply_filters('blocksy_autoloader_classes_map', [
|
25 |
+
'ExtensionsManager' => 'framework/extensions-manager.php',
|
26 |
+
'ExtensionsManagerApi' => 'framework/extensions-manager-api.php',
|
27 |
+
'Dashboard' => 'framework/dashboard.php',
|
28 |
+
'ThemeIntegration' => 'framework/theme-integration.php',
|
29 |
+
'CacheResetManager' => 'framework/cache-reset-manager.php',
|
30 |
+
|
31 |
+
'GoogleAnalytics' => 'framework/features/google-analytics.php',
|
32 |
+
'OpenGraphMetaData' => 'framework/features/opengraph-meta-data.php',
|
33 |
+
'HeaderAdditions' => 'framework/features/header.php',
|
34 |
+
'ConditionsManager' => 'framework/features/conditions-manager.php',
|
35 |
+
|
36 |
+
'Cli' => 'framework/cli.php',
|
37 |
+
|
38 |
+
'DynamicCss' => 'framework/features/dynamic-css.php',
|
39 |
+
'CustomizerOptionsManager' => 'framework/features/customizer-options-manager.php',
|
40 |
+
'DemoInstall' => 'framework/features/demo-install.php',
|
41 |
+
'DemoInstallContentExport' => 'framework/features/demo-install/content-export.php',
|
42 |
+
'DemoInstallWidgetsExport' => 'framework/features/demo-install/widgets-export.php',
|
43 |
+
'DemoInstallOptionsExport' => 'framework/features/demo-install/options-export.php',
|
44 |
+
|
45 |
+
'DemoInstallChildThemeInstaller' => 'framework/features/demo-install/child-theme.php',
|
46 |
+
'DemoInstallPluginsInstaller' => 'framework/features/demo-install/required-plugins.php',
|
47 |
+
'DemoInstallPluginsUninstaller' => 'framework/features/demo-install/plugins-uninstaller.php',
|
48 |
+
'DemoInstallContentInstaller' => 'framework/features/demo-install/content-installer.php',
|
49 |
+
'DemoInstallOptionsInstaller' => 'framework/features/demo-install/options-import.php',
|
50 |
+
'DemoInstallWidgetsInstaller' => 'framework/features/demo-install/widgets-import.php',
|
51 |
+
'DemoInstallContentEraser' => 'framework/features/demo-install/content-eraser.php',
|
52 |
+
'DemoInstallFakeContentEraser' => 'framework/features/demo-install/fake-content-eraser.php',
|
53 |
+
'DemoInstallFinalActions' => 'framework/features/demo-install/install-finish.php',
|
54 |
+
'Premium' => 'framework/premium/pro.php',
|
55 |
+
|
56 |
+
/**
|
57 |
+
* No namespace
|
58 |
+
*/
|
59 |
+
'_BlocksyWidgetFactory' => 'framework/widgets-manager.php',
|
60 |
+
'_Blocksy_WP_Import' => 'framework/features/demo-install/wp-importer.php',
|
61 |
+
]);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Run autoloader.
|
66 |
+
*
|
67 |
+
* Register a function as `__autoload()` implementation.
|
68 |
+
*
|
69 |
+
* @static
|
70 |
+
*/
|
71 |
+
public static function run() {
|
72 |
+
spl_autoload_register([__CLASS__, 'autoload']);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Load class.
|
77 |
+
*
|
78 |
+
* For a given class name, require the class file.
|
79 |
+
*
|
80 |
+
* @static
|
81 |
+
*
|
82 |
+
* @param string $relative_class_name Class name.
|
83 |
+
*/
|
84 |
+
private static function load_class($relative_class_name) {
|
85 |
+
if (isset( self::get_classes_map()[$relative_class_name])) {
|
86 |
+
$filename = BLOCKSY_PATH . '/' . self::get_classes_map()[$relative_class_name];
|
87 |
+
} else {
|
88 |
+
$filename = strtolower(
|
89 |
+
preg_replace(
|
90 |
+
['/([a-z])([A-Z])/', '/_/', '/\\\/'],
|
91 |
+
['$1-$2', '-', DIRECTORY_SEPARATOR],
|
92 |
+
$relative_class_name
|
93 |
+
)
|
94 |
+
);
|
95 |
+
|
96 |
+
$filename = BLOCKSY_PATH . $filename . '.php';
|
97 |
+
}
|
98 |
+
|
99 |
+
if (is_readable($filename)) {
|
100 |
+
require $filename;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Autoload.
|
106 |
+
*
|
107 |
+
* For a given class, check if it exist and load it.
|
108 |
+
*
|
109 |
+
* @static
|
110 |
+
*
|
111 |
+
* @param string $class Class name.
|
112 |
+
*/
|
113 |
+
private static function autoload($class) {
|
114 |
+
if (
|
115 |
+
0 !== strpos($class, __NAMESPACE__ . '\\')
|
116 |
+
&&
|
117 |
+
! isset(self::get_classes_map()['_' . $class])
|
118 |
+
) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
$relative_class_name = preg_replace('/^' . __NAMESPACE__ . '\\\/', '', $class);
|
123 |
+
|
124 |
+
$final_class_name = __NAMESPACE__ . '\\' . $relative_class_name;
|
125 |
+
|
126 |
+
if (isset(self::get_classes_map()['_' . $relative_class_name])) {
|
127 |
+
$final_class_name = $relative_class_name;
|
128 |
+
$relative_class_name = '_' . $relative_class_name;
|
129 |
+
}
|
130 |
+
|
131 |
+
if (! class_exists($final_class_name)) {
|
132 |
+
self::load_class($relative_class_name);
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
trunk/framework/cache-reset-manager.php
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Blocksy;
|
4 |
+
|
5 |
+
class CacheResetManager {
|
6 |
+
public function __construct() {
|
7 |
+
add_action(
|
8 |
+
'blocksy:cache-manager:purge-all',
|
9 |
+
function () {
|
10 |
+
$this->run_cache_purge();
|
11 |
+
}
|
12 |
+
);
|
13 |
+
|
14 |
+
add_action(
|
15 |
+
'upgrader_process_complete',
|
16 |
+
[$this, 'handle_update'],
|
17 |
+
10, 2
|
18 |
+
);
|
19 |
+
}
|
20 |
+
|
21 |
+
public function handle_update($upgrader, $options) {
|
22 |
+
if ($options['action'] !== 'update') {
|
23 |
+
return;
|
24 |
+
}
|
25 |
+
|
26 |
+
if ($options['type'] === 'theme') {
|
27 |
+
if (in_array('blocksy', $options['themes'])) {
|
28 |
+
$this->run_cache_purge();
|
29 |
+
do_action('blocksy:dynamic-css:regenere_css_files');
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
if ($options['type'] === 'plugin') {
|
34 |
+
$plugins = [];
|
35 |
+
|
36 |
+
if (isset($options['plugins']) && is_array($options['plugins'])) {
|
37 |
+
$plugins = $options['plugins'];
|
38 |
+
}
|
39 |
+
|
40 |
+
if (in_array(BLOCKSY_PLUGIN_BASE, $plugins)) {
|
41 |
+
$this->run_cache_purge();
|
42 |
+
do_action('blocksy:dynamic-css:regenere_css_files');
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
public function run_cache_purge() {
|
48 |
+
# Purge all W3 Total Cache
|
49 |
+
if (function_exists('w3tc_pgcache_flush')) {
|
50 |
+
w3tc_pgcache_flush();
|
51 |
+
}
|
52 |
+
|
53 |
+
if (function_exists('w3tc_flush_all')) {
|
54 |
+
w3tc_flush_all();
|
55 |
+
}
|
56 |
+
|
57 |
+
# Purge WP Super Cache
|
58 |
+
if (function_exists('wp_cache_clear_cache')) {
|
59 |
+
wp_cache_clear_cache();
|
60 |
+
}
|
61 |
+
|
62 |
+
if (isset($GLOBALS['wp_fastest_cache'])) {
|
63 |
+
if (method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')) {
|
64 |
+
$GLOBALS['wp_fastest_cache']->deleteCache();
|
65 |
+
$GLOBALS['wp_fastest_cache']->deleteCache(true);
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
if (function_exists('cachify_flush_cache')) {
|
70 |
+
cachify_flush_cache();
|
71 |
+
}
|
72 |
+
|
73 |
+
if (class_exists("comet_cache")) {
|
74 |
+
\comet_cache::clear();
|
75 |
+
}
|
76 |
+
|
77 |
+
if (class_exists("zencache")) {
|
78 |
+
\zencache::clear();
|
79 |
+
}
|
80 |
+
|
81 |
+
if (class_exists('LiteSpeed_Cache_Tags')) {
|
82 |
+
\LiteSpeed_Cache_Tags::add_purge_tag('*');
|
83 |
+
}
|
84 |
+
|
85 |
+
if (function_exists('sg_cachepress_purge_cache')) {
|
86 |
+
sg_cachepress_purge_cache();
|
87 |
+
}
|
88 |
+
|
89 |
+
if (class_exists('LiteSpeed_Cache_Purge')) {
|
90 |
+
\LiteSpeed_Cache_Purge::purge_all('Clear Cache For Me');
|
91 |
+
}
|
92 |
+
|
93 |
+
if (class_exists('WP_Optimize') && defined('WPO_PLUGIN_MAIN_PATH')) {
|
94 |
+
if (! class_exists('WP_Optimize_Cache_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'cache/class-cache-commands.php');
|
95 |
+
if (! class_exists('WP_Optimize_Minify_Commands')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-commands.php');
|
96 |
+
if (! class_exists('WP_Optimize_Minify_Cache_Functions')) include_once(WPO_PLUGIN_MAIN_PATH . 'minify/class-wp-optimize-minify-cache-functions.php');
|
97 |
+
|
98 |
+
if (class_exists('WP_Optimize_Cache_Commands')) {
|
99 |
+
$wpoptimize_cache_commands = new \WP_Optimize_Cache_Commands();
|
100 |
+
$wpoptimize_cache_commands->purge_page_cache();
|
101 |
+
}
|
102 |
+
|
103 |
+
if (class_exists('WP_Optimize_Minify_Commands')) {
|
104 |
+
$wpoptimize_minify_commands = new \WP_Optimize_Minify_Commands();
|
105 |
+
$wpoptimize_minify_commands->purge_minify_cache();
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
if (
|
110 |
+
class_exists('WPaaS\Plugin')
|
111 |
+
&&
|
112 |
+
function_exists('fastvelocity_godaddy_request')
|
113 |
+
) {
|
114 |
+
fastvelocity_godaddy_request('BAN');
|
115 |
+
}
|
116 |
+
|
117 |
+
# Purge WP Engine
|
118 |
+
if (class_exists("WpeCommon")) {
|
119 |
+
if (method_exists('WpeCommon', 'purge_memcached')) {
|
120 |
+
\WpeCommon::purge_memcached();
|
121 |
+
}
|
122 |
+
|
123 |
+
if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
|
124 |
+
\WpeCommon::clear_maxcdn_cache();
|
125 |
+
}
|
126 |
+
|
127 |
+
if (method_exists('WpeCommon', 'purge_varnish_cache')) {
|
128 |
+
\WpeCommon::purge_varnish_cache();
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
if (function_exists('rocket_clean_domain')) {
|
133 |
+
rocket_clean_domain();
|
134 |
+
}
|
135 |
+
|
136 |
+
if (function_exists('wp_cache_clean_cache')) {
|
137 |
+
global $file_prefix;
|
138 |
+
wp_cache_clean_cache( $file_prefix, true );
|
139 |
+
}
|
140 |
+
|
141 |
+
if (class_exists('autoptimizeCache')) {
|
142 |
+
\autoptimizeCache::clearall();
|
143 |
+
}
|
144 |
+
|
145 |
+
if (function_exists('fvm_purge_all')) {
|
146 |
+
fvm_purge_all();
|
147 |
+
}
|
148 |
+
|
149 |
+
if (function_exists('fastvelocity_purge_others')) {
|
150 |
+
fastvelocity_purge_others();
|
151 |
+
}
|
152 |
+
|
153 |
+
# wordpress default cache
|
154 |
+
if (function_exists('wp_cache_flush')) {
|
155 |
+
wp_cache_flush();
|
156 |
+
}
|
157 |
+
|
158 |
+
# https://wordpress.org/plugins/hummingbird-performance/
|
159 |
+
do_action('wphb_clear_page_cache');
|
160 |
+
|
161 |
+
if (class_exists('Swift_Performance_Cache')) {
|
162 |
+
\Swift_Performance_Cache::clear_all_cache();
|
163 |
+
}
|
164 |
+
|
165 |
+
if (class_exists('\SiteGround_Optimizer\Supercacher\Supercacher')) {
|
166 |
+
\SiteGround_Optimizer\Supercacher\Supercacher::get_instance()->purge_everything();
|
167 |
+
do_action('siteground_delete_assets');
|
168 |
+
}
|
169 |
+
|
170 |
+
if (class_exists('ShortPixelAI')) {
|
171 |
+
\ShortPixelAI::clear_css_cache();
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
trunk/framework/cli.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Blocksy;
|
4 |
+
|
5 |
+
class Cli {
|
6 |
+
public function __construct() {
|
7 |
+
\WP_CLI::add_command('blocksy demo plugins', function ($args) {
|
8 |
+
$plugins = [
|
9 |
+
'coblocks',
|
10 |
+
'elementor',
|
11 |
+
'contact-form-7',
|
12 |
+
'woocommerce'
|
13 |
+
];
|
14 |
+
|
15 |
+
foreach ($plugins as $plugin) {
|
16 |
+
\WP_CLI::runcommand('plugin install ' . $plugin, [] );
|
17 |
+
\WP_CLI::runcommand('plugin activate ' . $plugin, [] );
|
18 |
+
}
|
19 |
+
});
|
20 |
+
|
21 |
+
\WP_CLI::add_command('blocksy demo options', function ($args) {
|
22 |
+
$options = new DemoInstallOptionsInstaller([
|
23 |
+
'has_streaming' => false,
|
24 |
+
'demo_name' => 'Main:elementor'
|
25 |
+
]);
|
26 |
+
|
27 |
+
$options->import();
|
28 |
+
});
|
29 |
+
|
30 |
+
\WP_CLI::add_command('blocksy widgets drop', function ($args) {
|
31 |
+
$sidebars_widgets = get_option('sidebars_widgets', array());
|
32 |
+
|
33 |
+
if (! isset($sidebars_widgets['wp_inactive_widgets'])) {
|
34 |
+
$sidebars_widgets['wp_inactive_widgets'] = [];
|
35 |
+
}
|
36 |
+
|
37 |
+
foreach ($sidebars_widgets as $sidebar_id => $widgets) {
|
38 |
+
if (! $widgets) continue;
|
39 |
+
if ($sidebar_id === 'wp_inactive_widgets') {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
+
if ($sidebar_id === 'array_version') {
|
44 |
+
continue;
|
45 |
+
}
|
46 |
+
|
47 |
+
foreach ($widgets as $widget_id) {
|
48 |
+
$sidebars_widgets['wp_inactive_widgets'][] = $widget_id;
|
49 |
+
}
|
50 |
+
|
51 |
+
$sidebars_widgets[$sidebar_id] = [];
|
52 |
+
}
|
53 |
+
|
54 |
+
update_option('sidebars_widgets', $sidebars_widgets);
|
55 |
+
unset($sidebars_widgets['array_version']);
|
56 |
+
|
57 |
+
set_theme_mod('sidebars_widgets', [
|
58 |
+
'time' => time(),
|
59 |
+
'data' => $sidebars_widgets
|
60 |
+
]);
|
61 |
+
});
|
62 |
+
|
63 |
+
\WP_CLI::add_command('blocksy demo widgets', function ($args) {
|
64 |
+
$options = new DemoInstallWidgetsInstaller([
|
65 |
+
'has_streaming' => false,
|
66 |
+
'demo_name' => 'Blocksy News:elementor'
|
67 |
+
]);
|
68 |
+
|
69 |
+
$options->import();
|
70 |
+
});
|
71 |
+
|
72 |
+
\WP_CLI::add_command('blocksy demo content', function ($args) {
|
73 |
+
$options = new DemoInstallContentInstaller([
|
74 |
+
'has_streaming' => false,
|
75 |
+
'demo_name' => 'Main:elementor'
|
76 |
+
]);
|
77 |
+
|
78 |
+
$options->import();
|
79 |
+
});
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
trunk/framework/dashboard.php
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Blocksy;
|
4 |
+
|
5 |
+
class Dashboard {
|
6 |
+
public function __construct() {
|
7 |
+
add_action(
|
8 |
+
'admin_enqueue_scripts',
|
9 |
+
[ $this, 'enqueue_static' ],
|
10 |
+
100
|
11 |
+
);
|
12 |
+
|
13 |
+
add_action('admin_body_class', function ($class) {
|
14 |
+
if (blc_fs()->is_activation_mode()) {
|
15 |
+
$class .= ' blocksy-fs-optin-dashboard';
|
16 |
+
}
|
17 |
+
|
18 |
+
return $class;
|
19 |
+
});
|
20 |
+
|
21 |
+
blc_fs()->add_filter(
|
22 |
+
'connect-message_on-premium',
|
23 |
+
function ($text) {
|
24 |
+
if (strpos($text, '<br>') !== false) {
|
25 |
+
$exploded_message = explode('<br>', $text);
|
26 |
+
|
27 |
+
$text = '<span>' . $exploded_message[0] . '</span>' . $exploded_message[1];
|
28 |
+
}
|
29 |
+
|
30 |
+
return $text;
|
31 |
+
}
|
32 |
+
);
|
33 |
+
|
34 |
+
blc_fs()->add_filter(
|
35 |
+
'connect_message_on_update',
|
36 |
+
function (
|
37 |
+
$message,
|
38 |
+
$user_first_name,
|
39 |
+
$product_title,
|
40 |
+
$user_login,
|
41 |
+
$site_link,
|
42 |
+
$freemius_link
|
43 |
+
) {
|
44 |
+
$is_network_upgrade_mode = ( fs_is_network_admin() && blc_fs()->is_network_upgrade_mode() );
|
45 |
+
$slug = blc_fs()->get_slug();
|
46 |
+
$is_gdpr_required = \FS_GDPR_Manager::instance()->is_required();
|
47 |
+
$hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $user_first_name ) );
|
48 |
+
|
49 |
+
$default_optin_message = $is_gdpr_required ?
|
50 |
+
fs_text_inline( '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.', 'connect-message_on-update', $slug ) :
|
51 |
+
fs_text_inline( '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.', 'connect-message_on-update', $slug );
|
52 |
+
|
53 |
+
return (($is_network_upgrade_mode ?
|
54 |
+
'' :
|
55 |
+
/* translators: %s: name (e.g. Hey John,) */
|
56 |
+
'<span>' . $hey_x_text . '</span>'
|
57 |
+
) .
|
58 |
+
sprintf(
|
59 |
+
esc_html( $default_optin_message ),
|
60 |
+
'<b>' . esc_html( blc_fs()->get_plugin_name() ) . '</b>',
|
61 |
+
'<b>' . $user_login . '</b>',
|
62 |
+
$site_link,
|
63 |
+
$freemius_link
|
64 |
+
));
|
65 |
+
|
66 |
+
}, 10, 6
|
67 |
+
);
|
68 |
+
|
69 |
+
blc_fs()->add_action('connect/before', function () {
|
70 |
+
$path = dirname(__FILE__) . '/views/optin.php';
|
71 |
+
|
72 |
+
echo blc_call_fn(
|
73 |
+
['fn' => 'blocksy_render_view'],
|
74 |
+
$path,
|
75 |
+
[]
|
76 |
+
);
|
77 |
+
});
|
78 |
+
|
79 |
+
blc_fs()->add_action('connect/after', function () {
|
80 |
+
echo '</div>';
|
81 |
+
});
|
82 |
+
|
83 |
+
add_action(
|
84 |
+
'wp_ajax_blocksy_fs_connect_again',
|
85 |
+
function () {
|
86 |
+
if (! current_user_can('edit_theme_options')) {
|
87 |
+
wp_send_json_error();
|
88 |
+
}
|
89 |
+
|
90 |
+
blc_fs()->connect_again();
|
91 |
+
wp_send_json_success();
|
92 |
+
}
|
93 |
+
);
|
94 |
+
|
95 |
+
add_filter(
|
96 |
+
'blocksy_dashboard_localizations',
|
97 |
+
function ($d) {
|
98 |
+
$is_anonymous = blc_fs()->is_anonymous();
|
99 |
+
$connect_template = '';
|
100 |
+
|
101 |
+
if ($is_anonymous) {
|
102 |
+
ob_start();
|
103 |
+
blc_fs()->_connect_page_render();
|
104 |
+
$connect_template = ob_get_clean();
|
105 |
+
}
|
106 |
+
|
107 |
+
$result = [
|
108 |
+
'is_pro' => blc_fs()->is__premium_only(),
|
109 |
+
'is_anonymous' => $is_anonymous,
|
110 |
+
'connect_template' => $connect_template
|
111 |
+
];
|
112 |
+
|
113 |
+
if (Plugin::instance()->premium) {
|
114 |
+
$result['has_beta_consent'] = Plugin::instance()->premium->user_wants_beta_updates();
|
115 |
+
}
|
116 |
+
|
117 |
+
return array_merge($result, $d);
|
118 |
+
}
|
119 |
+
);
|
120 |
+
}
|
121 |
+
|
122 |
+
public function enqueue_static() {
|
123 |
+
if (! function_exists('blocksy_is_dashboard_page')) return;
|
124 |
+
if (! blocksy_is_dashboard_page()) return;
|
125 |
+
|
126 |
+
$data = get_plugin_data(BLOCKSY__FILE__);
|
127 |
+
|
128 |
+
$deps = apply_filters('blocksy-dashboard-scripts-dependencies', [
|
129 |
+
'wp-i18n',
|
130 |
+
'ct-events',
|
131 |
+
'ct-options-scripts'
|
132 |
+
]);
|
133 |
+
|
134 |
+
wp_enqueue_script(
|
135 |
+
'blocksy-dashboard-scripts',
|
136 |
+
BLOCKSY_URL . 'static/bundle/dashboard.js',
|
137 |
+
$deps,
|
138 |
+
$data['Version'],
|
139 |
+
false
|
140 |
+
);
|
141 |
+
|
142 |
+
wp_enqueue_style(
|
143 |
+
'blocksy-dashboard-styles',
|
144 |
+
BLOCKSY_URL . 'static/bundle/dashboard.css',
|
145 |
+
[],
|
146 |
+
$data['Version']
|
147 |
+
);
|
148 |
+
}
|
149 |
+
}
|
trunk/framework/extensions-manager-api.php
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Blocksy;
|
4 |
+
|
5 |
+
class ExtensionsManagerApi {
|
6 |
+
public function __construct() {
|
7 |
+
$this->attach_ajax_actions();
|
8 |
+
|
9 |
+
if (wp_doing_ajax()) {
|
10 |
+
$manager = Plugin::instance()->extensions;
|
11 |
+
$manager->do_extensions_preboot();
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
protected $ajax_actions = [
|
16 |
+
'blocksy_extensions_status',
|
17 |
+
'blocksy_extension_activate',
|
18 |
+
'blocksy_extension_deactivate',
|
19 |
+
];
|
20 |
+
|
21 |
+
public function blocksy_extensions_status() {
|
22 |
+
$this->check_capability('edit_theme_options');
|
23 |
+
$manager = Plugin::instance()->extensions;
|
24 |
+
|
25 |
+
$maybe_input = json_decode(file_get_contents('php://input'), true);
|
26 |
+
|
27 |
+
$data = $manager->get_extensions([
|
28 |
+
'forced_reread' => true
|
29 |
+
]);
|
30 |
+
|
31 |
+
if (
|
32 |
+
$maybe_input
|
33 |
+
&&
|
34 |
+
isset($maybe_input['extension'])
|
35 |
+
&&
|
36 |
+
isset($maybe_input['extAction'])
|
37 |
+
) {
|
38 |
+
$ext_preboot = $manager->get($maybe_input['extension'], [
|
39 |
+
'type' => 'preboot'
|
40 |
+
]);
|
41 |
+
|
42 |
+
if (method_exists(
|
43 |
+
$ext_preboot, 'ext_action'
|
44 |
+
)) {
|
45 |
+
$result = $ext_preboot->ext_action($maybe_input['extAction']);
|
46 |
+
|
47 |
+
if ($result) {
|
48 |
+
$data[$maybe_input['extension']]['data'] = $result;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
wp_send_json_success($data);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function blocksy_extension_activate() {
|
57 |
+
$this->check_capability('edit_theme_options');
|
58 |
+
$manager = Plugin::instance()->extensions;
|
59 |
+
|
60 |
+
$manager->activate_extension($this->get_extension_from_request());
|
61 |
+
|
62 |
+
wp_send_json_success();
|
63 |
+
}
|
64 |
+
|
65 |
+
public function blocksy_extension_deactivate() {
|
66 |
+
$this->check_capability('edit_theme_options');
|
67 |
+
$manager = Plugin::instance()->extensions;
|
68 |
+
|
69 |
+
$manager->deactivate_extension($this->get_extension_from_request());
|
70 |
+
|
71 |
+
wp_send_json_success();
|
72 |
+
}
|
73 |
+
|
74 |
+
public function check_capability( $cap = 'install_plugins' ) {
|
75 |
+
$manager = Plugin::instance()->extensions;
|
76 |
+
|
77 |
+
if ( ! $manager->can( $cap ) ) {
|
78 |
+
wp_send_json_error();
|
79 |
+
}
|
80 |
+
|
81 |
+
return true;
|
82 |
+
}
|
83 |
+
|
84 |
+
public function get_extension_from_request() {
|
85 |
+
if ( ! isset( $_POST['ext'] ) ) {
|
86 |
+
wp_send_json_error();
|
87 |
+
}
|
88 |
+
|
89 |
+
return addslashes($_POST['ext']);
|
90 |
+
}
|
91 |
+
|
92 |
+
public function attach_ajax_actions() {
|
93 |
+
foreach ( $this->ajax_actions as $action ) {
|
94 |
+
add_action(
|
95 |
+
'wp_ajax_' . $action,
|
96 |
+
[ $this, $action ]
|
97 |
+
);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
trunk/framework/extensions-manager.php
ADDED
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|