Skip to content

Maint/deps 2023 12 01 #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"require": {
"saltus/framework": "dev-main"
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"require-dev": {
"phpunit/phpunit": "^8"
}
Expand Down
157 changes: 73 additions & 84 deletions build/composer.lock

Large diffs are not rendered by default.

14,735 changes: 3,678 additions & 11,057 deletions build/package-lock.json

Large diffs are not rendered by default.

24 changes: 15 additions & 9 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,30 @@
"homepage": "https://saltus.dev"
},
"devDependencies": {
"browser-sync": "^2.26.7",
"grunt": "^1.0.4",
"autoprefixer": "^10.4.16",
"browser-sync": "^2.29.3",
"cssnano": "^6.0.1",
"grunt": "^1.6.1",
"grunt-checktextdomain": "^1.0.1",
"grunt-composer": "^0.4.5",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-compress": "^1.6.0",
"grunt-contrib-compress": "^2.0.0",
"grunt-contrib-concat": "^2.1.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-cssmin": "^5.0.0",
"grunt-contrib-watch": "~1.1.0",
"grunt-git": "^1.0.14",
"grunt-git": "^1.1.1",
"grunt-notify": "^0.4.5",
"grunt-shell": "^3.0.1",
"grunt-version": "^1.3.2",
"grunt-postcss": "^0.9.0",
"grunt-rollup": "^12.0.0",
"grunt-shell": "^4.0.0",
"grunt-terser": "^2.0.0",
"grunt-version": "^3.0.0",
"grunt-wp-i18n": "^1.0.3",
"jit-grunt": "^0.10.0",
"load-grunt-config": "^3.0.1",
"load-grunt-config": "^4.0.1",
"load-grunt-tasks": "~5.1.0",
"semver": "^7.1.1",
"semver": "^7.5.4",
"time-grunt": "~2.0.0"
},
"eslintConfig": {
Expand Down
11 changes: 3 additions & 8 deletions framework-demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
if ( ! defined( 'WPINC' ) ) {
exit;
}
if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) {
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}

if ( class_exists( \Saltus\WP\Framework\Core::class ) ) {
Expand All @@ -31,7 +31,7 @@
* The path to the plugin root directory is mandatory,
* so it loads the models from a subdirectory.
*/
$framework = new \Saltus\WP\Framework\Core( dirname( __FILE__ ) );
$framework = new \Saltus\WP\Framework\Core( __DIR__ );
$framework->register();

/**
Expand All @@ -45,9 +45,4 @@ function () use ( $framework ) {
$plugin->init();
}
);

}




104 changes: 80 additions & 24 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,83 @@
<?xml version="1.0"?>
<ruleset name="Saltus">
<description>Saltus Coding Standards.</description>

<exclude-pattern>*/phpunit.xml*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>

<!-- Yoda conditions, we must ignore -->
<rule ref="WordPress.PHP.YodaConditions.NotYoda">
<severity>0</severity>
</rule>

<!-- Ignore lowercase filenames -->
<rule ref="Generic.Files.LowercasedFilename.NotFound">
<severity>0</severity>
</rule>
<rule ref="WordPress.Files.FileName">
<severity>0</severity>
</rule>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<severity>0</severity>
</rule>
<rule ref="WordPress-Extra" />
<description>Saltus Coding Standards.</description>

<exclude-pattern>*/phpunit.xml*</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>lib/*</exclude-pattern>


<rule ref="WordPress-Extra">

<!-- # files -->
<!-- Ignore lowercase filenames -->
<exclude name="Generic.Files.LowercasedFilename.NotFound"/>
<!-- Do not enforce 'class-' prefix and hyffens -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>

<!-- # WP VIP: Generates too many false positives -->
<exclude name="WordPress.WP.CapitalPDangit.Misspelled"/>
<exclude name="WordPress.WP.CapitalPDangit.MisspelledInComment"/>

<!-- # wp nonsense -->
<!-- ignore yoda -->
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<!-- too many rules -->
<exclude name="PEAR.Functions.FunctionCallSignature.requiredSpacesAfterOpen"/>
<exclude name="PEAR.Functions.FunctionCallSignature.requiredSpacesBeforeClose"/>
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"/>
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine"/>
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
<!-- Allow ternary forms -->
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
<!-- Prefer [] instead of array() -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="Generic.Arrays.DisallowLongArraySyntax.Found"/>
<!-- common -->
<exclude name="PSR2.Classes.ClassDeclaration.ImplementsLine"/>
<exclude name="PSR2.Classes.ClassDeclaration.ExtendsLine"/>
</rule>


<!-- Add extra word delimiter for hooks. -->
<rule ref="WordPress.NamingConventions.ValidHookName">
<properties>
<property name="additionalWordDelimiters" value="/"/>
</properties>
</rule>

<!-- # from yoast: https://github.com/Yoast/yoastcs/blob/develop/Yoast/ruleset.xml -->
<!-- If a conscious choice has been made for a non-strict comparison, that's ok.
I.e. when `strict` has been explicitely set to `false` in an array comparison,
it will be allowed. -->
<exclude name="WordPress.PHP.StrictInArray.FoundNonStrictFalse"/>
<!-- In contrast to WPCS: disallow Yoda conditions. (PHPCS 3.5.0) -->
<rule ref="Generic.ControlStructures.DisallowYodaConditions"/>

<!-- # code quality -->
<!-- cyclomatic -->
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
</rule>
<!-- php compat -->
<rule ref="PHPCompatibility"/>

<!-- phpcs parameters -->
<file>./src/</file>
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="12"/>
<config name="testVersion" value="7.0-"/>

<config name="installed_paths" value="/srv/dev/coding_standards/wpcs/,/srv/dev/coding_standards/PHPCSUtils/,/srv/dev/coding_standards/PHPCSExtra/,/srv/dev/coding_standards/PHPCompatibility" />

</ruleset>
1 change: 0 additions & 1 deletion src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,4 @@ private function set_assets() {
$assets = new Plugin\Assets( $this );
$assets->load_assets();
}

}
2 changes: 0 additions & 2 deletions src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class Loader {
*/
public function __construct( Core $core ) {
$this->core = $core;

}

/**
Expand All @@ -45,4 +44,3 @@ public function __construct( Core $core ) {
public function run() {
}
}

1 change: 0 additions & 1 deletion src/Plugin/I18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ public function load_plugin_textdomain( string $plugin_dirname ) {
$plugin_dirname . '/languages/'
);
}

}
12 changes: 6 additions & 6 deletions src/models/post-type-all.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
),
'shortcode' => array(
'title' => __( 'Shortcode', 'framework-demo' ),
'function' => function() {
'function' => function () {
global $post;
echo esc_html( '[display-book id="' . $post->ID . '"]' );
},
Expand Down Expand Up @@ -82,10 +82,6 @@
'attributes' => __( 'Book Attributes', 'framework-demo' ),
'insert_into_item' => __( 'Insert into book', 'framework-demo' ),
'uploaded_to_this_item' => __( 'Uploaded to this book', 'framework-demo' ),
'featured_image' => __( 'Featured Image', 'framework-demo' ),
'set_featured_image' => __( 'Set featured image', 'framework-demo' ),
'remove_featured_image' => __( 'Remove featured image', 'framework-demo' ),
'use_featured_image' => __( 'Use featured image', 'framework-demo' ),
'filter_items_list' => __( 'Filter books list', 'framework-demo' ),
'items_list_navigation' => __( 'Books list navigation', 'framework-demo' ),
'items_list' => __( 'Books list', 'framework-demo' ),
Expand All @@ -109,14 +105,19 @@
],
'bulk_messages' => [
'updated_singular' => __( 'Book updated. Yay!', 'framework-demo' ),
/* translators: %s: Number of Books. */
'updated_plural' => __( '%s Books updated. Yay!', 'framework-demo' ),
'locked_singular' => __( 'Book not updated, somebody is editing it', 'framework-demo' ),
/* translators: %s: Number of Books. */
'locked_plural' => __( '%s Books not updated, somebody is editing them', 'framework-demo' ),
'deleted_singular' => __( 'Book permanetly deleted. Fahrenheit 451 team was here?', 'framework-demo' ),
/* translators: %s: Number of Books. */
'deleted_plural' => __( '%s Books permanently deleted. Why? :(', 'framework-demo' ),
'trashed_singular' => __( 'Book moved to the trash. I\'m sad :(', 'framework-demo' ),
/* translators: %s: Number of Books. */
'trashed_plural' => __( '%s Books moved to the trash. Why? :(', 'framework-demo' ),
'untrashed_singular' => __( 'Book recovered from trash. Well done!', 'framework-demo' ),
/* translators: %s: Number of Books. */
'untrashed_plural' => __( '%s Books saved from the enemies!', 'framework-demo' ),
],
// overrides some of the available button labels and placeholders
Expand Down Expand Up @@ -254,7 +255,6 @@
],
],


'custom' => [
'title' => __( 'CSS', 'framework-demo' ),
'desc' => __( 'Add custom styles to the pages loading the layouts.', 'framework-demo' ),
Expand Down
8 changes: 4 additions & 4 deletions src/models/taxonomy-multiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
'type' => 'tag',
'name' => 'country',
'labels' => [
'has_one' => 'Country',
'has_many' => 'Countries',
'has_one' => 'Country',
'has_many' => 'Countries',
'overrides' => [
'labels' => [
'menu_name' => 'Places',
]
],
],
],
// args - third parameter for register_taxonomy
'options' => [
'options' => [
'description' => 'Description for this taxonomy',
'public' => true,
'show_in_menu' => true,
Expand Down