Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
markonikolas committed Sep 14, 2024
0 parents commit 8fe3af3
Show file tree
Hide file tree
Showing 17 changed files with 24,905 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# config
.idea
.vscode

# compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# coverage directory used by tools like istanbul
coverage

# dependency directories
node_modules
vendor

# generated
dist
build

# logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# optional npm cache directory
.npm

# optional eslint cache
.eslintcache

# output of `npm pack`
*.tgz

# output of `wp-scripts plugin-zip`
*.zip

# secrects
.env

# cache
phpcs.cache
70 changes: 70 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0"?>
<ruleset name="Funky Headline">

<file>.</file>

<exclude-pattern>*/.git/*</exclude-pattern>
<exclude-pattern>/build/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<exclude-pattern>*.css</exclude-pattern>
<exclude-pattern>*.scss</exclude-pattern>

<arg value="sp"/>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="50"/>
<arg name="cache" value="./phpcs.cache"/>

<rule ref="WordPress-Extra">
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<exclude name="WordPress.PHP.YodaConditions"/>
</rule>

<rule ref="WordPress-Docs"/>

<rule ref="WordPress-VIP-Go"/>

<rule ref="PSR1.Classes.ClassDeclaration"/>

<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="alignMultilineItems" value="!=100"/>
</properties>
</rule>

<rule ref="PSR2.Methods.FunctionClosingBrace"/>

<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>

<rule ref="Generic.ControlStructures.DisallowYodaConditions"/>

<rule ref="Generic.Commenting.Todo"/>

<rule ref="PHPCompatibility">
<exclude name="PHPCompatibility.PHP.NewConstants.t_finallyFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_yieldFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_ellipsisFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_powFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_pow_equalFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_spaceshipFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_coalesceFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_coalesce_equalFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_yield_fromFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_traitFound"/>
</rule>

<config name="minimum_wp_version" value="6.5"/>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="funky-headline"/>
</property>
</properties>
</rule>
</ruleset>
9 changes: 9 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"core": null,
"phpVersion": "8.3",
"plugins": ["."],
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": true
}
}
32 changes: 32 additions & 0 deletions Inc/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Main plugin file
*
* @package funky-headline
*/

namespace FunkyHeadline;

/**
* Main plugin class
*/
class Plugin {

/**
* Hooks into init.
*
* @return void
*/
public function init(): void {
add_action( 'init', [ $this, 'register' ] );
}

/**
* Register block.
*
* @return void
*/
public function register(): void {
register_block_type( plugin_dir_path( __DIR__ ) . '/build' );
}
}
25 changes: 25 additions & 0 deletions block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Plugin Name: Funky Headline
* Description: A funky headline block with an eye-catching look :)
* Requires at least: 6.5
* Requires PHP: 8.0
* Version: 0.0.1
* Author: Marko Nikolaš
* License: GPL-2.0
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: funky-headline
* Domain Path: funky-headline
*
* @package funky-headline
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

require_once __DIR__ . '/vendor/autoload.php';

use FunkyHeadline\Plugin;

( new Plugin() )->init();
53 changes: 53 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "markonikolas/funky-headline",
"description": "A funky headline block with an eye-catching look :)",
"type": "project",
"license": "GPL-2.0-only",
"scripts": {
"lint": "phpcs",
"lint:fix": "phpcbf"
},
"authors": [
{
"name": "Marko Nikolaš",
"email": "36996299+markonikolas@users.noreply.github.com"
}
],
"require-dev": {
"wordpress/wordpress": "6.6.2",
"squizlabs/php_codesniffer": "*",
"wp-coding-standards/wpcs": "^3.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"automattic/vipwpcs": "^3.0"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
},
{
"type": "package",
"package": [
{
"name": "wordpress/wordpress",
"version": "6.6.2",
"source": {
"url": "https://github.com/wordpress/wordpress",
"type": "git",
"reference": "00a39b7"
}
}
]
}
],
"autoload": {
"psr-4": {
"FunkyHeadline\\": "Inc/"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 8fe3af3

Please sign in to comment.