diff --git a/.buildignore b/.buildignore index 21e8d383..00142c57 100644 --- a/.buildignore +++ b/.buildignore @@ -15,7 +15,6 @@ package.json phpcs.xml README.md webpack.config.js -vendor/ .github/ .buildignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aae65597..43a01d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,30 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- + - name: "Debug info: show tooling versions" + continue-on-error: true + run: | + set +e + echo "Start debug Info" + echo "Date: ${{ steps.date.outputs.date }}" + echo "PHP Version: $(php -v)" + echo "Composer Version: $(composer --version)" + echo "Node Version: $(node --version)" + echo "NPM Version: $(npm --version)" + echo "GIT Version: $(git --version)" + echo "The github context is:" + echo "${{ toJson(github) }}" + echo "The Theme version is:" + echo "${{ env.PACKAGE_VERSION }}" + echo "The Theme slug is:" + echo "${{ env.THEME_SLUG }}" + echo "End debug Info" + echo "exitcode=$?" >> $GITHUB_OUTPUT - name: Install Dependencies run: npm ci + - name: Install Composer dependencies + run: + composer install --no-dev - name: Bump version on push to release or develop if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/develop') run: | diff --git a/assets/dev/js/admin/pages/settings-page.js b/assets/dev/js/admin/pages/settings-page.js index 10e791bc..4abccfd2 100644 --- a/assets/dev/js/admin/pages/settings-page.js +++ b/assets/dev/js/admin/pages/settings-page.js @@ -116,6 +116,19 @@ export const SettingsPage = () => {

{ __( 'Hello Theme Settings', 'hello-elementor' ) }

+
diff --git a/composer.json b/composer.json index 81ece3d4..8b5991c0 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,13 @@ { "name": "elementor/hello-theme", - "require": { + "require-dev": { "squizlabs/php_codesniffer": "^3.6", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "wp-coding-standards/wpcs": "^2.3" }, + "require": { + "elementor/wp-notifications-package": "dev-tweak/ED-16360-initial-wip" + }, "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true @@ -12,5 +15,11 @@ }, "scripts": { "lint": "phpcs --extensions=php -p" - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/elementor/wp-notifications-package" + } + ] } diff --git a/composer.lock b/composer.lock index 11f7fd8e..2a796f04 100644 --- a/composer.lock +++ b/composer.lock @@ -4,31 +4,71 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fb532360aa2153f005e713784f2f1a50", + "content-hash": "986bbddca7dec5609d5a6b3ff85356e8", "packages": [ + { + "name": "elementor/wp-notifications-package", + "version": "dev-tweak/ED-16360-initial-wip", + "source": { + "type": "git", + "url": "https://github.com/elementor/wp-notifications-package.git", + "reference": "db1f35ccf4e9a9d7a681f722108dd8e20a82e4ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/elementor/wp-notifications-package/zipball/db1f35ccf4e9a9d7a681f722108dd8e20a82e4ac", + "reference": "db1f35ccf4e9a9d7a681f722108dd8e20a82e4ac", + "shasum": "" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0", + "squizlabs/php_codesniffer": "^3.10.2", + "wp-coding-standards/wpcs": "^3.1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Elementor\\WPNotificationsPackage\\": "src/" + } + }, + "scripts": { + "lint": [ + "vendor/bin/phpcs --standard=./phpcs.xml ." + ], + "lint:fix": [ + "vendor/bin/phpcbf ." + ] + }, + "support": { + "source": "https://github.com/elementor/wp-notifications-package/tree/tweak/ED-16360-initial-wip" + }, + "time": "2024-12-26T12:24:55+00:00" + } + ], + "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -49,6 +89,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -60,6 +104,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -74,20 +119,20 @@ "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2020-12-07T18:04:37+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.11.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079", + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079", "shasum": "" }, "require": { @@ -97,11 +142,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -116,21 +161,45 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2021-04-09T00:54:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-12-11T16:04:26+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -184,13 +253,14 @@ "time": "2020-05-13T23:57:56+00:00" } ], - "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "elementor/wp-notifications-package": 20 + }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.0.0" + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/footer.php b/footer.php index 06fcc8c1..3b68a623 100644 --- a/footer.php +++ b/footer.php @@ -6,7 +6,6 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } diff --git a/functions.php b/functions.php index 10a4355f..12c5c83b 100644 --- a/functions.php +++ b/functions.php @@ -5,6 +5,8 @@ * @package HelloElementor */ +use Elementor\WPNotificationsPackage\V100\Notifications as ThemeNotifications; + if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } @@ -261,3 +263,21 @@ function hello_elementor_body_open() { wp_body_open(); } } + +function hello_elementor_get_theme_notifications(): ThemeNotifications { + static $notifications = null; + + if ( null === $notifications ) { + require get_template_directory() . '/vendor/autoload.php'; + + $notifications = new ThemeNotifications( + 'hello-elementor', + HELLO_ELEMENTOR_VERSION, + 'theme' + ); + } + + return $notifications; +} + +hello_elementor_get_theme_notifications(); diff --git a/header.php b/header.php index 52e737e0..d2b2f29c 100644 --- a/header.php +++ b/header.php @@ -6,7 +6,6 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } diff --git a/includes/admin-functions.php b/includes/admin-functions.php index 37f7c5ae..ba573b0b 100644 --- a/includes/admin-functions.php +++ b/includes/admin-functions.php @@ -1,5 +1,4 @@
get_notifications_by_conditions(); + ?> + + + +

+ +

+

+ + +
+
diff --git a/template-parts/archive.php b/template-parts/archive.php index 89dcd2cf..6e359658 100644 --- a/template-parts/archive.php +++ b/template-parts/archive.php @@ -4,10 +4,10 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } + ?>
diff --git a/template-parts/dynamic-footer.php b/template-parts/dynamic-footer.php index fded5724..cfb39994 100644 --- a/template-parts/dynamic-footer.php +++ b/template-parts/dynamic-footer.php @@ -4,7 +4,6 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } diff --git a/template-parts/dynamic-header.php b/template-parts/dynamic-header.php index eaeb399f..d7576aea 100644 --- a/template-parts/dynamic-header.php +++ b/template-parts/dynamic-header.php @@ -4,7 +4,6 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } diff --git a/template-parts/footer.php b/template-parts/footer.php index 408e6ae4..aae95e10 100644 --- a/template-parts/footer.php +++ b/template-parts/footer.php @@ -4,7 +4,6 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } diff --git a/template-parts/header.php b/template-parts/header.php index 86b2fea9..bb5f1eba 100644 --- a/template-parts/header.php +++ b/template-parts/header.php @@ -4,10 +4,10 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } + $site_name = get_bloginfo( 'name' ); $tagline = get_bloginfo( 'description', 'display' ); $header_nav_menu = wp_nav_menu( [ diff --git a/template-parts/search.php b/template-parts/search.php index 9767562c..0b4142c1 100644 --- a/template-parts/search.php +++ b/template-parts/search.php @@ -4,10 +4,10 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } + ?>
diff --git a/template-parts/single.php b/template-parts/single.php index 4d96de11..f16c3e20 100644 --- a/template-parts/single.php +++ b/template-parts/single.php @@ -4,7 +4,6 @@ * * @package HelloElementor */ - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. }