### Install Dependencies, Build, and Start Development Server Source: https://github.com/yoast/wordpress-seo/blob/trunk/apps/content-analysis-webworker/readme.md These commands are used to set up and run the content analysis web worker project locally. Ensure you have Node.js and Yarn installed. ```shell yarn # Install the dependencies. yarn build # Build the project. yarn start # Start the development server. ``` -------------------------------- ### Local Development Setup for UI Library Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/ui-library/readme.md Install dependencies, run Storybook for local development, and build a static Storybook site using yarn commands. ```sh # Install dependencies yarn install # Run Storybook for local development yarn storybook # Build a static Storybook yarn build:storybook ``` -------------------------------- ### Install Dependencies Source: https://github.com/yoast/wordpress-seo/blob/trunk/apps/content-analysis-api/readme.md Install the project dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Install PHPUnit Globally Source: https://github.com/yoast/wordpress-seo/blob/trunk/tests/Unit/README.md Install a specific version of PHPUnit globally for first-time use. ```bash composer global require phpunit/phpunit:5.7 ``` -------------------------------- ### Start Server Source: https://github.com/yoast/wordpress-seo/blob/trunk/apps/content-analysis-api/readme.md Start the Node.js server. You can either let it pick a random port or specify a port using the PORT environment variable. ```bash yarn start # Picks a random port. ``` ```bash PORT=3000 yarn start # Specify a port (used in documentation). ``` -------------------------------- ### Install YoastSEO.js with npm Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/README.md Install the YoastSEO.js package using npm. ```bash npm install yoastseo ``` -------------------------------- ### Start Local WordPress Environment Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/e2e-tests/README.md Starts a local WordPress environment using @wordpress/env and sets up necessary plugins. Ensure Docker is running. ```bash bash e2e-test-env-setup.sh ``` -------------------------------- ### Install Browserslist Config with npm Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/browserslist-config/README.md Install the necessary packages for Browserslist configuration using npm. ```shell $ npm install browserslist @yoast/browserslist-config --save-dev ``` -------------------------------- ### Install Dependencies Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/e2e-tests/README.md Installs project dependencies using composer and yarn, and builds the development environment. ```bash composer install yarn grunt build:dev ``` -------------------------------- ### Install Xdebug Extension Source: https://github.com/yoast/wordpress-seo/blob/trunk/tests/Unit/README.md Install the Xdebug extension using PECL for code coverage analysis. ```bash pecl install xdebug ``` -------------------------------- ### Install YoastSEO.js with Yarn Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/README.md Install the YoastSEO.js package using Yarn. ```bash yarn add yoastseo ``` -------------------------------- ### Install Browserslist Config with Yarn Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/browserslist-config/README.md Install the necessary packages for Browserslist configuration using Yarn. ```shell $ yarn add --dev @yoast/browserslist-config ``` -------------------------------- ### Install Dependencies and Run Storybook Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/related-keyphrase-suggestions/readme.md Commands to install dependencies and run Storybook for local development. Also includes a command to build a static Storybook. ```sh yarn install ``` ```sh yarn storybook ``` ```sh yarn build:storybook ``` -------------------------------- ### Install Yoast UI Library Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/ui-library/readme.md Install the UI library and its peer dependencies using Yarn. ```sh yarn add @yoast/ui-library react react-dom ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/yoast/wordpress-seo/blob/trunk/tests/Unit/README.md Execute this command to install the necessary Composer dependencies, which may include tools for linting and codestyle checks. ```bash composer install ``` -------------------------------- ### Website Structured Metadata Example Source: https://github.com/yoast/wordpress-seo/wiki/Yoast-SEO-product-sheet Example of ld+json for Website schema, including name, alternateName, and SearchAction for sitelinks searchbox. ```JSON { "@context":"http:\/\/schema.org", "@type":"WebSite", "url":"https:\/\/yoast.com\/", "name":"Yoast", "alternateName":"Yoast.com", "potentialAction":{ "@type":"SearchAction", "target":"https:\/\/yoast.com\/?s={search_term_string}", "query-input":"required name=search_term_string" } } ``` -------------------------------- ### Install Yoast Tailwind CSS Preset Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/tailwindcss-preset/readme.md Install the preset and its peer dependencies using Yarn. ```shell yarn add --dev @yoast/tailwindcss-preset tailwindcss @tailwindcss/container-queries @tailwindcss/forms ``` -------------------------------- ### Install WordPress SEO Development Version with Composer Source: https://github.com/yoast/wordpress-seo/wiki/Downloading-WordPress-SEO-development-version Use these Composer commands to install the development version of WordPress SEO, including all dependencies. Ensure Composer is installed and updated before running. ```bash composer selfupdate composer install ``` -------------------------------- ### Automate Composer Install with Git Hooks Source: https://github.com/yoast/wordpress-seo/wiki/Using-Composer A bash script to be placed in .git/hooks/post-checkout to automatically run 'composer install' when composer.lock changes. ```bash #!/bin/bash # Put this file at: .git/hooks/post-checkout # and make it executable # You can install it system wide too, see http://stackoverflow.com/a/2293578/685587 PREV_COMMIT=$1 POST_COMMIT=$2 GIT_DIR=$(git rev-parse --git-dir) GIT_DIR_MERGE="$GIT_DIR"/rebase-merge GIT_DIR_APPLY="$GIT_DIR"/rebase-apply GIT_MERGE_REBASE=false [[ (-d "$GIT_DIR_MERGE" && -f "$GIT_DIR_MERGE/interactive") || -d "$GIT_DIR_APPLY" ]] && GIT_MERGE_REBASE=true NOCOLOR='\e[0m' REDCOLOR='\e[37;41m' function composer.lock { echo -e "$REDCOLOR composer.lock has changed: running composer install $NOCOLOR" COMPOSER= if [ -f composer.phar ]; then COMPOSER="php composer.phar" fi which composer > /dev/null 2>&1 if [ $? ]; then COMPOSER="composer" fi if [[ $GIT_MERGE_REBASE = false && -n "$COMPOSER" ]]; then $COMPOSER install fi } function package.json { echo -e "$REDCOLOR package.json has changed: running npm install $NOCOLOR" which npm > /dev/null 2>&1 if [[ $GIT_MERGE_REBASE = false && $? ]]; then npm install fi } FUNCS=$(declare -F -p | cut -d " " -f 3) for FUNC in $FUNCS do DIFF=$(git diff --shortstat $PREV_COMMIT..$POST_COMMIT $FUNC 2>/dev/null) if [[ $DIFF != "" ]]; then $FUNC fi done ``` -------------------------------- ### WHILE...DO Loop Example: Day Tracking Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html An example of a WHILE...DO loop that tracks the day of the week. It increments v_Day_of_Week every 24 hours and resets it to 1 on the eighth day. ```Pseudocode While v_Var1 = 0 DO { INC v_Day_of_Week IF v_Day_of_Week = 8 THEN v_Day_of_Week = 1 TIME(24 Hr) } ``` -------------------------------- ### Synonym Example Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/GLOSSARY.md Provides examples of synonyms for a given keyphrase, illustrating alternative terms that can be used for content variation and to avoid keyword stuffing. ```text Keyphrase: "car" Synonyms: "automobile", "vehicle", "motor vehicle" ``` -------------------------------- ### Boolean Operators Examples Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Illustrates the use of basic and compound boolean operators for creating conditional expressions in ProcessModel. ```ProcessModel a_Weight = 2.5 v_Total_Pieces = 50 ``` ```ProcessModel a_Weight > 2.5 v_Total_Pieces > 50 ``` ```ProcessModel a_Weight < 2.5 v_Total_Pieces < 50 ``` ```ProcessModel a_Weight <> 2.5 v_Total_Pieces <> 50 ``` ```ProcessModel a_Weight >= 2.5 v_Total_Pieces >= 50 ``` ```ProcessModel a_Weight <= 2.5 v_Total_Pieces <= 50 ``` ```ProcessModel a_Weight = 25 AND v_Total = 30 v_Total >= 20 AND v_Total <= 30 ``` ```ProcessModel a_Weight > 5 OR v_Total <= 20 v_Total = 30 OR a_Weight =15 ``` -------------------------------- ### Examples of Boolean Expressions Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Demonstrates the construction of simple and compound boolean expressions using numeric expressions and logical operators within IF...THEN statements. ```ProcessModel IF v_Total_Pieces > 5 * a_Pkg_Qty THEN... ``` ```ProcessModel IF (a_Weight + 5) <= (a_Pkg_Qty / 2) THEN... ``` ```ProcessModel IF N(25, 4.8) + a_Weight = v_Total_Pieces - 10 THEN... ``` ```ProcessModel IF a_Weight >= v_Total_Pieces AND a_Pkg_Qty > 20 THEN... ``` ```ProcessModel IF v_Total_Pieces = a_Pkg_Qty OR a_Pkg_Qty > 35 THEN... ``` -------------------------------- ### Simple GET Statement Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Requests a single unit of a resource named 'Operator'. ```ProcessModel GET Operator ``` -------------------------------- ### User-Defined Distribution Example Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Defines a custom distribution based on percentages and corresponding values. Supports two to five outcomes. ```text D n (% 1 ,x 1 ,...% n ,x n ) % = percentage (entries must total 100%) x = value (numeric or pre-defined descriptor) n = number of%, x entries between 2 and 5 **example:** D3(20, 35, 30, 45, 50, 37.5) ``` ```text D2(38, 25, 62, 43) ``` -------------------------------- ### Triangular Distribution Example Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Shows how to use a triangular distribution to define a time range for an activity, incorporating minimum, most likely, and maximum values. ```ProcessModel _TIME (T(2, 2.6, 4) min)_ ``` -------------------------------- ### GET Statement with Quantity Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Requests three units of the resource named 'Operator'. ```ProcessModel GET 3 Operator ``` -------------------------------- ### Numeric Expression Examples Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Illustrates various ways to construct numeric expressions by combining attributes, variables, distributions, and constants with mathematical operators. Parentheses can be used to control evaluation order. ```Pseudocode a_Attr1 ``` ```Pseudocode 50.91 ``` ```Pseudocode v_Var1 + 5 ``` ```Pseudocode v_Total_Pieces + 5 * a_Pkg_Qty ``` ```Pseudocode (a_Weight + 5) * (a_Pkg_Qty / 2) ``` ```Pseudocode N(25, 4.8) + a_Weight * (v_Total_Pieces - 10) ``` -------------------------------- ### Triangular Distribution Example Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Defines a triangular distribution with minimum, mode, and maximum values. Ideal for modeling activity times due to its flexibility and realism. ```text T(a, b, c,s) a = minimum, b=mode, c=maximum, s = stream (optional) **example:** T(2,10,13) ``` ```text T(1, 3.4, 15) ``` -------------------------------- ### Calculate processing time with GROUPQTY() Source: https://github.com/yoast/wordpress-seo/blob/trunk/packages/yoastseo/examples/PerformanceAnalyses/text3.html Calculate the processing time for a batched entity using GROUPQTY(). This example processes documents in a folder, with each document taking 3.0 minutes. ```plaintext TIME (GROUPQTY() *3.0 min) ```