Skip to content
EngramiumPublic

Repository files navigation

LinkStar - Developer Documentation

A WordPress Gutenberg block plugin that provides a customizable link block with advanced styling options and hover effects.

Overview

LinkStar adds a powerful link block to the WordPress block editor with extensive customization options including hover effects, icon support, and advanced styling controls. The block is perfect for creating call-to-action buttons, styled navigation elements, and interactive link components.

Requirements

  • WordPress: 6.7 or higher
  • PHP: 7.4 or higher
  • Node.js: 18.0 or higher
  • npm/yarn: Latest stable version

Quick Start

Installation

  1. Clone the repository into your WordPress plugins directory:
cd wp-content/plugins/
git clone <repository-url> link-star
cd link-star
  1. Install dependencies:
npm install
# or
yarn install
  1. Start development mode:
npm start
# or
yarn start
  1. Activate the plugin in WordPress admin

Development

Available Scripts

Command Description
npm start Start development mode with hot reload and blocks manifest
npm run build Build production-ready files with blocks manifest
npm run format Format code using WordPress Prettier config
npm run lint:js Lint JavaScript files
npm run lint:css Lint CSS/SCSS files
npm run packages-update Update @wordpress packages to latest versions
npm run plugin-zip Create a distributable plugin ZIP file

Development Workflow

  1. Start Development Server:
npm start

This will watch for changes and automatically rebuild the block.

  1. Make Your Changes:

    • Edit files in src/linkstar/
    • Changes will be hot-reloaded in the editor
  2. Build for Production:

npm run build
  1. Test Your Changes:
    • Add the block to a page/post in the WordPress editor
    • Test all features and styling options
    • Check browser console for errors

Building for Production

Create Production Build

npm run build

This will:

  1. Compile and minify JavaScript
  2. Process and minify SCSS to CSS
  3. Generate asset dependency files
  4. Create blocks manifest
  5. Output to build/ directory

Create Distribution Package

npm run plugin-zip

This creates a link-star.zip file ready for:

  • WordPress.org submission
  • Manual installation
  • Client delivery

Files Included in Distribution

The plugin ZIP includes:

  • build/ - Compiled assets
  • languages/ - Translation files
  • link-star.php - Main plugin file
  • readme.txt - WordPress.org readme
  • Excludes: node_modules/, src/, dev config files

Internationalization (i18n)

Text Domain

The plugin uses the text domain: link-star

Adding Translatable Strings

In JavaScript:

import { __ } from '@wordpress/i18n';

const label = __('Link URL', 'linkstar');

In PHP:

__( 'LinkStar', 'linkstar' );

Generating Translation Files

Translation files should be placed in the languages/ directory following WordPress naming conventions.


Happy Coding! 🚀

Releases

Packages

Contributors

Languages