├── .gitignore ├── README.md ├── composer.json ├── composer.lock ├── composer.phar ├── phpcs.xml ├── src ├── core.php ├── factories │ └── generator-factory.php ├── generators │ ├── aioseo-generator.php │ ├── core-generator.php │ └── woocommerce-generator.php ├── helper-functions.php └── woocommerce.php └── wp-cli-faker.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WP CLI Faker 2 | 3 | This package introduces two new WP CLI commands to generate fake data. 4 | 5 | ## Install as WordPress package 6 | 7 | This command can be installed for WP CLI by running: 8 | 9 | `wp package install yoast/wp-cli-faker`. 10 | 11 | In many cases the default memory limit will not be enough to run composer so running the following instead is generally recommended: 12 | 13 | `php -d memory_limit=512M "$(which wp)" package install yoast/wp-cli-faker` 14 | 15 | ## Install as WordPress Plugin 16 | 17 | Clone the repo into your WordPress plugins folder. 18 | 19 | This repo requires composer 1+ in order to be compatible with WP cli, so to use it as a plugin you must install dependencies with composer 1+. For ease of use composer 1 is shipped as a .phar file. 20 | 21 | Run `php composer.phar install`. 22 | 23 | ## Core 24 | 25 | The `wp faker core content` command generates authors, attachments, categories, tags, posts and pages. It supports the following flags: 26 | - authors: The number of authors to generate, by default 10. 27 | - attachments: The number of attachments to generate, by default 10. 28 | - attachment-keyword: The keyword to search for on loremflickr.com, by default wordpress. 29 | - categories: The number of categories to generate, by default 10. 30 | - tags: The number of tags to generate, by default 25. 31 | - posts: The number of posts to generate, by default 100. 32 | - pages: The number of pages to generate, by default 5. 33 | 34 | ## WooCommerce 35 | 36 | The `wp faker woocommerce products` command generates attachments, product categories, brands ( if Perfect WooCommerce Brands is installed ), products and review. It supports the following flags: 37 | - attachments: The number of attachments to generate, by default 10. 38 | - attachment-keyword: The keyword to search for on loremflickr.com, by default jewelry. 39 | - categories: The number of product categories to generate, by default 25. 40 | - brands: The number of brands to generate, by default 25. 41 | - products: The number of products to generate, by default 300. 42 | - min-reviews: The minimum number of reviews to generate per product, by default 3. 43 | - max-reviews: The maximum number of reviews to generate per product, by default 8. 44 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yoast/wp-cli-faker", 3 | "repositories": [ 4 | { 5 | "type": "composer", 6 | "url": "https://wpackagist.org" 7 | } 8 | ], 9 | "require": { 10 | "fzaninotto/faker": "^1.9" 11 | }, 12 | "authors": [ 13 | { 14 | "name": "Herre Groen", 15 | "email": "herre@yoast.com" 16 | } 17 | ], 18 | "autoload": { 19 | "files": [ 20 | "src/core.php", 21 | "src/woocommerce.php", 22 | "src/helper-functions.php" 23 | ], 24 | "classmap": [ 25 | "src/" 26 | ] 27 | }, 28 | "require-dev": { 29 | "woocommerce/woocommerce": "^3.8", 30 | "wpackagist-plugin/perfect-woocommerce-brands": "^1.7", 31 | "yoast/yoastcs": "^2.0", 32 | "wp-cli/wp-cli": "^2.4" 33 | }, 34 | "extra": { 35 | "installer-disable": true 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "84149eb86f14b78135ee6e7b8342452f", 8 | "packages": [ 9 | { 10 | "name": "fzaninotto/faker", 11 | "version": "v1.9.1", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/fzaninotto/Faker.git", 15 | "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", 20 | "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": "^5.3.3 || ^7.0" 25 | }, 26 | "require-dev": { 27 | "ext-intl": "*", 28 | "phpunit/phpunit": "^4.8.35 || ^5.7", 29 | "squizlabs/php_codesniffer": "^2.9.2" 30 | }, 31 | "type": "library", 32 | "extra": { 33 | "branch-alias": { 34 | "dev-master": "1.9-dev" 35 | } 36 | }, 37 | "autoload": { 38 | "psr-4": { 39 | "Faker\\": "src/Faker/" 40 | } 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "MIT" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "François Zaninotto" 49 | } 50 | ], 51 | "description": "Faker is a PHP library that generates fake data for you.", 52 | "keywords": [ 53 | "data", 54 | "faker", 55 | "fixtures" 56 | ], 57 | "time": "2019-12-12T13:22:17+00:00" 58 | } 59 | ], 60 | "packages-dev": [ 61 | { 62 | "name": "automattic/jetpack-autoloader", 63 | "version": "v1.2.0", 64 | "source": { 65 | "type": "git", 66 | "url": "https://github.com/Automattic/jetpack-autoloader.git", 67 | "reference": "4ad9631e68e9da8b8a764615766287becfb27f81" 68 | }, 69 | "dist": { 70 | "type": "zip", 71 | "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/4ad9631e68e9da8b8a764615766287becfb27f81", 72 | "reference": "4ad9631e68e9da8b8a764615766287becfb27f81", 73 | "shasum": "" 74 | }, 75 | "require": { 76 | "composer-plugin-api": "^1.1" 77 | }, 78 | "require-dev": { 79 | "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5" 80 | }, 81 | "type": "composer-plugin", 82 | "extra": { 83 | "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin" 84 | }, 85 | "autoload": { 86 | "psr-4": { 87 | "Automattic\\Jetpack\\Autoloader\\": "src" 88 | } 89 | }, 90 | "notification-url": "https://packagist.org/downloads/", 91 | "license": [ 92 | "GPL-2.0-or-later" 93 | ], 94 | "description": "Creates a custom autoloader for a plugin or theme.", 95 | "time": "2019-06-24T15:13:23+00:00" 96 | }, 97 | { 98 | "name": "composer/installers", 99 | "version": "v1.7.0", 100 | "source": { 101 | "type": "git", 102 | "url": "https://github.com/composer/installers.git", 103 | "reference": "141b272484481432cda342727a427dc1e206bfa0" 104 | }, 105 | "dist": { 106 | "type": "zip", 107 | "url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0", 108 | "reference": "141b272484481432cda342727a427dc1e206bfa0", 109 | "shasum": "" 110 | }, 111 | "require": { 112 | "composer-plugin-api": "^1.0" 113 | }, 114 | "replace": { 115 | "roundcube/plugin-installer": "*", 116 | "shama/baton": "*" 117 | }, 118 | "require-dev": { 119 | "composer/composer": "1.0.*@dev", 120 | "phpunit/phpunit": "^4.8.36" 121 | }, 122 | "type": "composer-plugin", 123 | "extra": { 124 | "class": "Composer\\Installers\\Plugin", 125 | "branch-alias": { 126 | "dev-master": "1.0-dev" 127 | } 128 | }, 129 | "autoload": { 130 | "psr-4": { 131 | "Composer\\Installers\\": "src/Composer/Installers" 132 | } 133 | }, 134 | "notification-url": "https://packagist.org/downloads/", 135 | "license": [ 136 | "MIT" 137 | ], 138 | "authors": [ 139 | { 140 | "name": "Kyle Robinson Young", 141 | "email": "kyle@dontkry.com", 142 | "homepage": "https://github.com/shama" 143 | } 144 | ], 145 | "description": "A multi-framework Composer library installer", 146 | "homepage": "https://composer.github.io/installers/", 147 | "keywords": [ 148 | "Craft", 149 | "Dolibarr", 150 | "Eliasis", 151 | "Hurad", 152 | "ImageCMS", 153 | "Kanboard", 154 | "Lan Management System", 155 | "MODX Evo", 156 | "Mautic", 157 | "Maya", 158 | "OXID", 159 | "Plentymarkets", 160 | "Porto", 161 | "RadPHP", 162 | "SMF", 163 | "Thelia", 164 | "Whmcs", 165 | "WolfCMS", 166 | "agl", 167 | "aimeos", 168 | "annotatecms", 169 | "attogram", 170 | "bitrix", 171 | "cakephp", 172 | "chef", 173 | "cockpit", 174 | "codeigniter", 175 | "concrete5", 176 | "croogo", 177 | "dokuwiki", 178 | "drupal", 179 | "eZ Platform", 180 | "elgg", 181 | "expressionengine", 182 | "fuelphp", 183 | "grav", 184 | "installer", 185 | "itop", 186 | "joomla", 187 | "known", 188 | "kohana", 189 | "laravel", 190 | "lavalite", 191 | "lithium", 192 | "magento", 193 | "majima", 194 | "mako", 195 | "mediawiki", 196 | "modulework", 197 | "modx", 198 | "moodle", 199 | "osclass", 200 | "phpbb", 201 | "piwik", 202 | "ppi", 203 | "puppet", 204 | "pxcms", 205 | "reindex", 206 | "roundcube", 207 | "shopware", 208 | "silverstripe", 209 | "sydes", 210 | "symfony", 211 | "typo3", 212 | "wordpress", 213 | "yawik", 214 | "zend", 215 | "zikula" 216 | ], 217 | "time": "2019-08-12T15:00:31+00:00" 218 | }, 219 | { 220 | "name": "cweagans/composer-patches", 221 | "version": "1.6.7", 222 | "source": { 223 | "type": "git", 224 | "url": "https://github.com/cweagans/composer-patches.git", 225 | "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590" 226 | }, 227 | "dist": { 228 | "type": "zip", 229 | "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/2e6f72a2ad8d59cd7e2b729f218bf42adb14f590", 230 | "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590", 231 | "shasum": "" 232 | }, 233 | "require": { 234 | "composer-plugin-api": "^1.0", 235 | "php": ">=5.3.0" 236 | }, 237 | "require-dev": { 238 | "composer/composer": "~1.0", 239 | "phpunit/phpunit": "~4.6" 240 | }, 241 | "type": "composer-plugin", 242 | "extra": { 243 | "class": "cweagans\\Composer\\Patches" 244 | }, 245 | "autoload": { 246 | "psr-4": { 247 | "cweagans\\Composer\\": "src" 248 | } 249 | }, 250 | "notification-url": "https://packagist.org/downloads/", 251 | "license": [ 252 | "BSD-3-Clause" 253 | ], 254 | "authors": [ 255 | { 256 | "name": "Cameron Eagans", 257 | "email": "me@cweagans.net" 258 | } 259 | ], 260 | "description": "Provides a way to patch Composer packages.", 261 | "time": "2019-08-29T20:11:49+00:00" 262 | }, 263 | { 264 | "name": "dealerdirect/phpcodesniffer-composer-installer", 265 | "version": "v0.5.0", 266 | "source": { 267 | "type": "git", 268 | "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", 269 | "reference": "e749410375ff6fb7a040a68878c656c2e610b132" 270 | }, 271 | "dist": { 272 | "type": "zip", 273 | "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", 274 | "reference": "e749410375ff6fb7a040a68878c656c2e610b132", 275 | "shasum": "" 276 | }, 277 | "require": { 278 | "composer-plugin-api": "^1.0", 279 | "php": "^5.3|^7", 280 | "squizlabs/php_codesniffer": "^2|^3" 281 | }, 282 | "require-dev": { 283 | "composer/composer": "*", 284 | "phpcompatibility/php-compatibility": "^9.0", 285 | "sensiolabs/security-checker": "^4.1.0" 286 | }, 287 | "type": "composer-plugin", 288 | "extra": { 289 | "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 290 | }, 291 | "autoload": { 292 | "psr-4": { 293 | "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 294 | } 295 | }, 296 | "notification-url": "https://packagist.org/downloads/", 297 | "license": [ 298 | "MIT" 299 | ], 300 | "authors": [ 301 | { 302 | "name": "Franck Nijhof", 303 | "email": "franck.nijhof@dealerdirect.com", 304 | "homepage": "http://www.frenck.nl", 305 | "role": "Developer / IT Manager" 306 | } 307 | ], 308 | "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 309 | "homepage": "http://www.dealerdirect.com", 310 | "keywords": [ 311 | "PHPCodeSniffer", 312 | "PHP_CodeSniffer", 313 | "code quality", 314 | "codesniffer", 315 | "composer", 316 | "installer", 317 | "phpcs", 318 | "plugin", 319 | "qa", 320 | "quality", 321 | "standard", 322 | "standards", 323 | "style guide", 324 | "stylecheck", 325 | "tests" 326 | ], 327 | "time": "2018-10-26T13:21:45+00:00" 328 | }, 329 | { 330 | "name": "mustache/mustache", 331 | "version": "v2.13.0", 332 | "source": { 333 | "type": "git", 334 | "url": "https://github.com/bobthecow/mustache.php.git", 335 | "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" 336 | }, 337 | "dist": { 338 | "type": "zip", 339 | "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", 340 | "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", 341 | "shasum": "" 342 | }, 343 | "require": { 344 | "php": ">=5.2.4" 345 | }, 346 | "require-dev": { 347 | "friendsofphp/php-cs-fixer": "~1.11", 348 | "phpunit/phpunit": "~3.7|~4.0|~5.0" 349 | }, 350 | "type": "library", 351 | "autoload": { 352 | "psr-0": { 353 | "Mustache": "src/" 354 | } 355 | }, 356 | "notification-url": "https://packagist.org/downloads/", 357 | "license": [ 358 | "MIT" 359 | ], 360 | "authors": [ 361 | { 362 | "name": "Justin Hileman", 363 | "email": "justin@justinhileman.info", 364 | "homepage": "http://justinhileman.com" 365 | } 366 | ], 367 | "description": "A Mustache implementation in PHP.", 368 | "homepage": "https://github.com/bobthecow/mustache.php", 369 | "keywords": [ 370 | "mustache", 371 | "templating" 372 | ], 373 | "time": "2019-11-23T21:40:31+00:00" 374 | }, 375 | { 376 | "name": "phpcompatibility/php-compatibility", 377 | "version": "9.3.5", 378 | "source": { 379 | "type": "git", 380 | "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 381 | "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 382 | }, 383 | "dist": { 384 | "type": "zip", 385 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 386 | "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 387 | "shasum": "" 388 | }, 389 | "require": { 390 | "php": ">=5.3", 391 | "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 392 | }, 393 | "conflict": { 394 | "squizlabs/php_codesniffer": "2.6.2" 395 | }, 396 | "require-dev": { 397 | "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 398 | }, 399 | "suggest": { 400 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 401 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 402 | }, 403 | "type": "phpcodesniffer-standard", 404 | "notification-url": "https://packagist.org/downloads/", 405 | "license": [ 406 | "LGPL-3.0-or-later" 407 | ], 408 | "authors": [ 409 | { 410 | "name": "Wim Godden", 411 | "homepage": "https://github.com/wimg", 412 | "role": "lead" 413 | }, 414 | { 415 | "name": "Juliette Reinders Folmer", 416 | "homepage": "https://github.com/jrfnl", 417 | "role": "lead" 418 | }, 419 | { 420 | "name": "Contributors", 421 | "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 422 | } 423 | ], 424 | "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 425 | "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 426 | "keywords": [ 427 | "compatibility", 428 | "phpcs", 429 | "standards" 430 | ], 431 | "time": "2019-12-27T09:44:58+00:00" 432 | }, 433 | { 434 | "name": "phpcompatibility/phpcompatibility-paragonie", 435 | "version": "1.3.0", 436 | "source": { 437 | "type": "git", 438 | "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", 439 | "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c" 440 | }, 441 | "dist": { 442 | "type": "zip", 443 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/b862bc32f7e860d0b164b199bd995e690b4b191c", 444 | "reference": "b862bc32f7e860d0b164b199bd995e690b4b191c", 445 | "shasum": "" 446 | }, 447 | "require": { 448 | "phpcompatibility/php-compatibility": "^9.0" 449 | }, 450 | "require-dev": { 451 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5", 452 | "paragonie/random_compat": "dev-master", 453 | "paragonie/sodium_compat": "dev-master" 454 | }, 455 | "suggest": { 456 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 457 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 458 | }, 459 | "type": "phpcodesniffer-standard", 460 | "notification-url": "https://packagist.org/downloads/", 461 | "license": [ 462 | "LGPL-3.0-or-later" 463 | ], 464 | "authors": [ 465 | { 466 | "name": "Wim Godden", 467 | "role": "lead" 468 | }, 469 | { 470 | "name": "Juliette Reinders Folmer", 471 | "role": "lead" 472 | } 473 | ], 474 | "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", 475 | "homepage": "http://phpcompatibility.com/", 476 | "keywords": [ 477 | "compatibility", 478 | "paragonie", 479 | "phpcs", 480 | "polyfill", 481 | "standards" 482 | ], 483 | "time": "2019-11-04T15:17:54+00:00" 484 | }, 485 | { 486 | "name": "phpcompatibility/phpcompatibility-wp", 487 | "version": "2.1.0", 488 | "source": { 489 | "type": "git", 490 | "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", 491 | "reference": "41bef18ba688af638b7310666db28e1ea9158b2f" 492 | }, 493 | "dist": { 494 | "type": "zip", 495 | "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f", 496 | "reference": "41bef18ba688af638b7310666db28e1ea9158b2f", 497 | "shasum": "" 498 | }, 499 | "require": { 500 | "phpcompatibility/php-compatibility": "^9.0", 501 | "phpcompatibility/phpcompatibility-paragonie": "^1.0" 502 | }, 503 | "require-dev": { 504 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5" 505 | }, 506 | "suggest": { 507 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 508 | "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 509 | }, 510 | "type": "phpcodesniffer-standard", 511 | "notification-url": "https://packagist.org/downloads/", 512 | "license": [ 513 | "LGPL-3.0-or-later" 514 | ], 515 | "authors": [ 516 | { 517 | "name": "Wim Godden", 518 | "role": "lead" 519 | }, 520 | { 521 | "name": "Juliette Reinders Folmer", 522 | "role": "lead" 523 | } 524 | ], 525 | "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", 526 | "homepage": "http://phpcompatibility.com/", 527 | "keywords": [ 528 | "compatibility", 529 | "phpcs", 530 | "standards", 531 | "wordpress" 532 | ], 533 | "time": "2019-08-28T14:22:28+00:00" 534 | }, 535 | { 536 | "name": "rmccue/requests", 537 | "version": "v1.7.0", 538 | "source": { 539 | "type": "git", 540 | "url": "https://github.com/rmccue/Requests.git", 541 | "reference": "87932f52ffad70504d93f04f15690cf16a089546" 542 | }, 543 | "dist": { 544 | "type": "zip", 545 | "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546", 546 | "reference": "87932f52ffad70504d93f04f15690cf16a089546", 547 | "shasum": "" 548 | }, 549 | "require": { 550 | "php": ">=5.2" 551 | }, 552 | "require-dev": { 553 | "requests/test-server": "dev-master" 554 | }, 555 | "type": "library", 556 | "autoload": { 557 | "psr-0": { 558 | "Requests": "library/" 559 | } 560 | }, 561 | "notification-url": "https://packagist.org/downloads/", 562 | "license": [ 563 | "ISC" 564 | ], 565 | "authors": [ 566 | { 567 | "name": "Ryan McCue", 568 | "homepage": "http://ryanmccue.info" 569 | } 570 | ], 571 | "description": "A HTTP library written in PHP, for human beings.", 572 | "homepage": "http://github.com/rmccue/Requests", 573 | "keywords": [ 574 | "curl", 575 | "fsockopen", 576 | "http", 577 | "idna", 578 | "ipv6", 579 | "iri", 580 | "sockets" 581 | ], 582 | "time": "2016-10-13T00:11:37+00:00" 583 | }, 584 | { 585 | "name": "squizlabs/php_codesniffer", 586 | "version": "3.5.3", 587 | "source": { 588 | "type": "git", 589 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 590 | "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" 591 | }, 592 | "dist": { 593 | "type": "zip", 594 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", 595 | "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", 596 | "shasum": "" 597 | }, 598 | "require": { 599 | "ext-simplexml": "*", 600 | "ext-tokenizer": "*", 601 | "ext-xmlwriter": "*", 602 | "php": ">=5.4.0" 603 | }, 604 | "require-dev": { 605 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 606 | }, 607 | "bin": [ 608 | "bin/phpcs", 609 | "bin/phpcbf" 610 | ], 611 | "type": "library", 612 | "extra": { 613 | "branch-alias": { 614 | "dev-master": "3.x-dev" 615 | } 616 | }, 617 | "notification-url": "https://packagist.org/downloads/", 618 | "license": [ 619 | "BSD-3-Clause" 620 | ], 621 | "authors": [ 622 | { 623 | "name": "Greg Sherwood", 624 | "role": "lead" 625 | } 626 | ], 627 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 628 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 629 | "keywords": [ 630 | "phpcs", 631 | "standards" 632 | ], 633 | "time": "2019-12-04T04:46:47+00:00" 634 | }, 635 | { 636 | "name": "symfony/finder", 637 | "version": "v5.0.2", 638 | "source": { 639 | "type": "git", 640 | "url": "https://github.com/symfony/finder.git", 641 | "reference": "17874dd8ab9a19422028ad56172fb294287a701b" 642 | }, 643 | "dist": { 644 | "type": "zip", 645 | "url": "https://api.github.com/repos/symfony/finder/zipball/17874dd8ab9a19422028ad56172fb294287a701b", 646 | "reference": "17874dd8ab9a19422028ad56172fb294287a701b", 647 | "shasum": "" 648 | }, 649 | "require": { 650 | "php": "^7.2.5" 651 | }, 652 | "type": "library", 653 | "extra": { 654 | "branch-alias": { 655 | "dev-master": "5.0-dev" 656 | } 657 | }, 658 | "autoload": { 659 | "psr-4": { 660 | "Symfony\\Component\\Finder\\": "" 661 | }, 662 | "exclude-from-classmap": [ 663 | "/Tests/" 664 | ] 665 | }, 666 | "notification-url": "https://packagist.org/downloads/", 667 | "license": [ 668 | "MIT" 669 | ], 670 | "authors": [ 671 | { 672 | "name": "Fabien Potencier", 673 | "email": "fabien@symfony.com" 674 | }, 675 | { 676 | "name": "Symfony Community", 677 | "homepage": "https://symfony.com/contributors" 678 | } 679 | ], 680 | "description": "Symfony Finder Component", 681 | "homepage": "https://symfony.com", 682 | "time": "2019-11-18T17:27:11+00:00" 683 | }, 684 | { 685 | "name": "woocommerce/woocommerce", 686 | "version": "3.8.1", 687 | "source": { 688 | "type": "git", 689 | "url": "https://github.com/woocommerce/woocommerce.git", 690 | "reference": "674d7f65ee1bfc10908e6d4a551687a08e0bb4a5" 691 | }, 692 | "dist": { 693 | "type": "zip", 694 | "url": "https://api.github.com/repos/woocommerce/woocommerce/zipball/674d7f65ee1bfc10908e6d4a551687a08e0bb4a5", 695 | "reference": "674d7f65ee1bfc10908e6d4a551687a08e0bb4a5", 696 | "shasum": "" 697 | }, 698 | "require": { 699 | "automattic/jetpack-autoloader": "^1.2.0", 700 | "composer/installers": "1.7.0", 701 | "php": ">=5.6|>=7.0", 702 | "woocommerce/woocommerce-blocks": "2.4.5", 703 | "woocommerce/woocommerce-rest-api": "1.0.3" 704 | }, 705 | "require-dev": { 706 | "phpunit/phpunit": "7.5.16", 707 | "woocommerce/woocommerce-sniffs": "0.0.7" 708 | }, 709 | "type": "wordpress-plugin", 710 | "extra": { 711 | "installer-paths": { 712 | "packages/woocommerce-rest-api": [ 713 | "woocommerce/woocommerce-rest-api" 714 | ], 715 | "packages/woocommerce-blocks": [ 716 | "woocommerce/woocommerce-blocks" 717 | ] 718 | }, 719 | "scripts-description": { 720 | "test": "Run unit tests", 721 | "phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer", 722 | "phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier" 723 | } 724 | }, 725 | "autoload": { 726 | "exclude-from-classmap": [ 727 | "includes/legacy", 728 | "includes/libraries" 729 | ], 730 | "psr-4": { 731 | "Automattic\\WooCommerce\\": "src/" 732 | } 733 | }, 734 | "notification-url": "https://packagist.org/downloads/", 735 | "license": [ 736 | "GPL-3.0-or-later" 737 | ], 738 | "description": "An eCommerce toolkit that helps you sell anything. Beautifully.", 739 | "homepage": "https://woocommerce.com/", 740 | "time": "2019-11-27T18:18:26+00:00" 741 | }, 742 | { 743 | "name": "woocommerce/woocommerce-blocks", 744 | "version": "v2.4.5", 745 | "source": { 746 | "type": "git", 747 | "url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git", 748 | "reference": "130bc40824f844c0870c94c0ad0aa7a6abb74f6f" 749 | }, 750 | "dist": { 751 | "type": "zip", 752 | "url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/130bc40824f844c0870c94c0ad0aa7a6abb74f6f", 753 | "reference": "130bc40824f844c0870c94c0ad0aa7a6abb74f6f", 754 | "shasum": "" 755 | }, 756 | "require": { 757 | "automattic/jetpack-autoloader": "1.2.0", 758 | "composer/installers": "1.7.0" 759 | }, 760 | "require-dev": { 761 | "phpunit/phpunit": "6.5.14", 762 | "woocommerce/woocommerce-sniffs": "0.0.6" 763 | }, 764 | "type": "wordpress-plugin", 765 | "extra": { 766 | "scripts-description": { 767 | "phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer", 768 | "phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier" 769 | } 770 | }, 771 | "autoload": { 772 | "psr-4": { 773 | "Automattic\\WooCommerce\\Blocks\\": "src/" 774 | } 775 | }, 776 | "notification-url": "https://packagist.org/downloads/", 777 | "license": [ 778 | "GPL-3.0-or-later" 779 | ], 780 | "description": "WooCommerce blocks for the Gutenberg editor.", 781 | "homepage": "https://woocommerce.com/", 782 | "keywords": [ 783 | "blocks", 784 | "gutenberg", 785 | "woocommerce" 786 | ], 787 | "time": "2019-11-02T13:48:18+00:00" 788 | }, 789 | { 790 | "name": "woocommerce/woocommerce-rest-api", 791 | "version": "1.0.3", 792 | "source": { 793 | "type": "git", 794 | "url": "https://github.com/woocommerce/woocommerce-rest-api.git", 795 | "reference": "7d9babf1c25890c32df3edb28b8351732640f5ce" 796 | }, 797 | "dist": { 798 | "type": "zip", 799 | "url": "https://api.github.com/repos/woocommerce/woocommerce-rest-api/zipball/7d9babf1c25890c32df3edb28b8351732640f5ce", 800 | "reference": "7d9babf1c25890c32df3edb28b8351732640f5ce", 801 | "shasum": "" 802 | }, 803 | "require": { 804 | "automattic/jetpack-autoloader": "1.2.0" 805 | }, 806 | "require-dev": { 807 | "phpunit/phpunit": "6.5.14", 808 | "woocommerce/woocommerce-sniffs": "0.0.6" 809 | }, 810 | "type": "wordpress-plugin", 811 | "autoload": { 812 | "classmap": [ 813 | "src/Controllers/Version1", 814 | "src/Controllers/Version2", 815 | "src/Controllers/Version3" 816 | ], 817 | "psr-4": { 818 | "Automattic\\WooCommerce\\RestApi\\": "src" 819 | } 820 | }, 821 | "notification-url": "https://packagist.org/downloads/", 822 | "license": [ 823 | "GPL-3.0-or-later" 824 | ], 825 | "description": "The WooCommerce core REST API.", 826 | "homepage": "https://github.com/woocommerce/woocommerce-rest-api", 827 | "time": "2019-07-16T14:27:40+00:00" 828 | }, 829 | { 830 | "name": "wp-cli/mustangostang-spyc", 831 | "version": "0.6.3", 832 | "source": { 833 | "type": "git", 834 | "url": "https://github.com/wp-cli/spyc.git", 835 | "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" 836 | }, 837 | "dist": { 838 | "type": "zip", 839 | "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", 840 | "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", 841 | "shasum": "" 842 | }, 843 | "require": { 844 | "php": ">=5.3.1" 845 | }, 846 | "require-dev": { 847 | "phpunit/phpunit": "4.3.*@dev" 848 | }, 849 | "type": "library", 850 | "extra": { 851 | "branch-alias": { 852 | "dev-master": "0.5.x-dev" 853 | } 854 | }, 855 | "autoload": { 856 | "psr-4": { 857 | "Mustangostang\\": "src/" 858 | }, 859 | "files": [ 860 | "includes/functions.php" 861 | ] 862 | }, 863 | "notification-url": "https://packagist.org/downloads/", 864 | "license": [ 865 | "MIT" 866 | ], 867 | "authors": [ 868 | { 869 | "name": "mustangostang", 870 | "email": "vlad.andersen@gmail.com" 871 | } 872 | ], 873 | "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", 874 | "homepage": "https://github.com/mustangostang/spyc/", 875 | "time": "2017-04-25T11:26:20+00:00" 876 | }, 877 | { 878 | "name": "wp-cli/php-cli-tools", 879 | "version": "v0.11.11", 880 | "source": { 881 | "type": "git", 882 | "url": "https://github.com/wp-cli/php-cli-tools.git", 883 | "reference": "fe9c7c44a9e1bf2196ec51dc38da0593dbf2993f" 884 | }, 885 | "dist": { 886 | "type": "zip", 887 | "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/fe9c7c44a9e1bf2196ec51dc38da0593dbf2993f", 888 | "reference": "fe9c7c44a9e1bf2196ec51dc38da0593dbf2993f", 889 | "shasum": "" 890 | }, 891 | "require": { 892 | "php": ">= 5.3.0" 893 | }, 894 | "type": "library", 895 | "autoload": { 896 | "psr-0": { 897 | "cli": "lib/" 898 | }, 899 | "files": [ 900 | "lib/cli/cli.php" 901 | ] 902 | }, 903 | "notification-url": "https://packagist.org/downloads/", 904 | "license": [ 905 | "MIT" 906 | ], 907 | "authors": [ 908 | { 909 | "name": "James Logsdon", 910 | "email": "jlogsdon@php.net", 911 | "role": "Developer" 912 | }, 913 | { 914 | "name": "Daniel Bachhuber", 915 | "email": "daniel@handbuilt.co", 916 | "role": "Maintainer" 917 | } 918 | ], 919 | "description": "Console utilities for PHP", 920 | "homepage": "http://github.com/wp-cli/php-cli-tools", 921 | "keywords": [ 922 | "cli", 923 | "console" 924 | ], 925 | "time": "2018-09-04T13:28:00+00:00" 926 | }, 927 | { 928 | "name": "wp-cli/wp-cli", 929 | "version": "v2.4.0", 930 | "source": { 931 | "type": "git", 932 | "url": "https://github.com/wp-cli/wp-cli.git", 933 | "reference": "74c949c74708e3a88ad0add70f3236c8675dfd85" 934 | }, 935 | "dist": { 936 | "type": "zip", 937 | "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/74c949c74708e3a88ad0add70f3236c8675dfd85", 938 | "reference": "74c949c74708e3a88ad0add70f3236c8675dfd85", 939 | "shasum": "" 940 | }, 941 | "require": { 942 | "cweagans/composer-patches": "^1.6", 943 | "ext-curl": "*", 944 | "mustache/mustache": "~2.4", 945 | "php": "^5.4 || ^7.0", 946 | "rmccue/requests": "~1.6", 947 | "symfony/finder": ">2.7", 948 | "wp-cli/mustangostang-spyc": "^0.6.3", 949 | "wp-cli/php-cli-tools": "~0.11.2" 950 | }, 951 | "require-dev": { 952 | "roave/security-advisories": "dev-master", 953 | "wp-cli/db-command": "^1.3 || ^2", 954 | "wp-cli/entity-command": "^1.2 || ^2", 955 | "wp-cli/extension-command": "^1.1 || ^2", 956 | "wp-cli/package-command": "^1 || ^2", 957 | "wp-cli/wp-cli-tests": "^2.1" 958 | }, 959 | "suggest": { 960 | "ext-readline": "Include for a better --prompt implementation", 961 | "ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates" 962 | }, 963 | "bin": [ 964 | "bin/wp", 965 | "bin/wp.bat" 966 | ], 967 | "type": "library", 968 | "extra": { 969 | "branch-alias": { 970 | "dev-master": "2.4.x-dev" 971 | }, 972 | "patches": { 973 | "mustache/mustache": { 974 | "Avoid notices on PHP 7.4+": "https://patch-diff.githubusercontent.com/raw/bobthecow/mustache.php/pull/349.patch" 975 | } 976 | } 977 | }, 978 | "autoload": { 979 | "psr-0": { 980 | "WP_CLI": "php" 981 | } 982 | }, 983 | "notification-url": "https://packagist.org/downloads/", 984 | "license": [ 985 | "MIT" 986 | ], 987 | "description": "WP-CLI framework", 988 | "homepage": "https://wp-cli.org", 989 | "keywords": [ 990 | "cli", 991 | "wordpress" 992 | ], 993 | "time": "2019-11-12T15:26:05+00:00" 994 | }, 995 | { 996 | "name": "wp-coding-standards/wpcs", 997 | "version": "2.2.0", 998 | "source": { 999 | "type": "git", 1000 | "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 1001 | "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a" 1002 | }, 1003 | "dist": { 1004 | "type": "zip", 1005 | "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/f90e8692ce97b693633db7ab20bfa78d930f536a", 1006 | "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a", 1007 | "shasum": "" 1008 | }, 1009 | "require": { 1010 | "php": ">=5.4", 1011 | "squizlabs/php_codesniffer": "^3.3.1" 1012 | }, 1013 | "require-dev": { 1014 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", 1015 | "phpcompatibility/php-compatibility": "^9.0", 1016 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 1017 | }, 1018 | "suggest": { 1019 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 1020 | }, 1021 | "type": "phpcodesniffer-standard", 1022 | "notification-url": "https://packagist.org/downloads/", 1023 | "license": [ 1024 | "MIT" 1025 | ], 1026 | "authors": [ 1027 | { 1028 | "name": "Contributors", 1029 | "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 1030 | } 1031 | ], 1032 | "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 1033 | "keywords": [ 1034 | "phpcs", 1035 | "standards", 1036 | "wordpress" 1037 | ], 1038 | "time": "2019-11-11T12:34:03+00:00" 1039 | }, 1040 | { 1041 | "name": "wpackagist-plugin/perfect-woocommerce-brands", 1042 | "version": "1.7.7", 1043 | "source": { 1044 | "type": "svn", 1045 | "url": "https://plugins.svn.wordpress.org/perfect-woocommerce-brands/", 1046 | "reference": "tags/1.7.7" 1047 | }, 1048 | "dist": { 1049 | "type": "zip", 1050 | "url": "https://downloads.wordpress.org/plugin/perfect-woocommerce-brands.1.7.7.zip" 1051 | }, 1052 | "require": { 1053 | "composer/installers": "~1.0" 1054 | }, 1055 | "type": "wordpress-plugin", 1056 | "homepage": "https://wordpress.org/plugins/perfect-woocommerce-brands/" 1057 | }, 1058 | { 1059 | "name": "yoast/yoastcs", 1060 | "version": "2.0.0", 1061 | "source": { 1062 | "type": "git", 1063 | "url": "https://github.com/Yoast/yoastcs.git", 1064 | "reference": "2f445bea2b94cfe352e3d5c11c1fc7071ca5545a" 1065 | }, 1066 | "dist": { 1067 | "type": "zip", 1068 | "url": "https://api.github.com/repos/Yoast/yoastcs/zipball/2f445bea2b94cfe352e3d5c11c1fc7071ca5545a", 1069 | "reference": "2f445bea2b94cfe352e3d5c11c1fc7071ca5545a", 1070 | "shasum": "" 1071 | }, 1072 | "require": { 1073 | "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", 1074 | "php": ">=5.4", 1075 | "phpcompatibility/phpcompatibility-wp": "^2.1.0", 1076 | "squizlabs/php_codesniffer": "^3.5.0", 1077 | "wp-coding-standards/wpcs": "^2.2.0" 1078 | }, 1079 | "require-dev": { 1080 | "jakub-onderka/php-console-highlighter": "^0.4", 1081 | "jakub-onderka/php-parallel-lint": "^1.0", 1082 | "phpcompatibility/php-compatibility": "^9.2.0", 1083 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0", 1084 | "roave/security-advisories": "dev-master" 1085 | }, 1086 | "type": "phpcodesniffer-standard", 1087 | "notification-url": "https://packagist.org/downloads/", 1088 | "license": [ 1089 | "MIT" 1090 | ], 1091 | "authors": [ 1092 | { 1093 | "name": "Team Yoast", 1094 | "email": "support@yoast.com", 1095 | "homepage": "https://yoast.com" 1096 | } 1097 | ], 1098 | "description": "PHP_CodeSniffer rules for Yoast projects", 1099 | "homepage": "https://github.com/Yoast/yoastcs", 1100 | "keywords": [ 1101 | "phpcs", 1102 | "standards", 1103 | "wordpress", 1104 | "yoast" 1105 | ], 1106 | "time": "2019-12-17T07:40:59+00:00" 1107 | } 1108 | ], 1109 | "aliases": [], 1110 | "minimum-stability": "stable", 1111 | "stability-flags": [], 1112 | "prefer-stable": false, 1113 | "prefer-lowest": false, 1114 | "platform": [], 1115 | "platform-dev": [] 1116 | } 1117 | -------------------------------------------------------------------------------- /composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yoast/wp-cli-faker/e1f34dc06bb70a1b6f4d23d508a521ab626f7163/composer.phar -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | WP CLI Faker rules for PHP_CodeSniffer 7 | 8 | 14 | 15 | ./src 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/core.php: -------------------------------------------------------------------------------- 1 | ] 19 | * : The number of authors to generate. 20 | * --- 21 | * default: 10 22 | * --- 23 | * 24 | * [--categories=] 25 | * : The number of categories to generate. 26 | * --- 27 | * default: 10 28 | * --- 29 | * 30 | * [--tags=] 31 | * : The number of tags to generate. 32 | * --- 33 | * default: 25 34 | * --- 35 | * 36 | * [--attachments=] 37 | * : The number of attachments to generate. 38 | * --- 39 | * default: 10 40 | * --- 41 | * 42 | * [--attachment-keyword=] 43 | * : The keyword used to generate attachments. 44 | * --- 45 | * default: WordPress 46 | * --- 47 | * 48 | * [--posts=] 49 | * : The number of posts to generate. 50 | * --- 51 | * default: 100 52 | * --- 53 | * 54 | * [--pages=] 55 | * : The number of pages to generate. 56 | * --- 57 | * default: 5 58 | * --- 59 | * 60 | * [--type=] 61 | * : The type of generator to use. Passing aioseo generators posts with aioseo meta. 62 | * --- 63 | * default: default 64 | * --- 65 | * 66 | * ## EXAMPLES 67 | * 68 | * wp faker core content 69 | * 70 | * @when after_wp_load 71 | * 72 | * @param string[] $args The command line arguments. 73 | * @param array $assoc_args The associative command line arguments. 74 | */ 75 | public function content( $args, $assoc_args ) { 76 | $generator = Generator_Factory::get_core_generator( $assoc_args['type'] ); 77 | 78 | $author_ids = generate_with_progress( 79 | 'author', 80 | (int) $assoc_args['authors'], 81 | function() use ( $generator ) { 82 | return $generator->generate_user(); 83 | } 84 | ); 85 | $category_ids = generate_with_progress( 86 | 'category', 87 | (int) $assoc_args['categories'], 88 | function( $i, $ids ) use ( $generator ) { 89 | return $generator->generate_term( 'category', $ids ); 90 | } 91 | ); 92 | 93 | $tag_ids = generate_with_progress( 94 | 'tag', 95 | (int) $assoc_args['tags'], 96 | function() use ( $generator ) { 97 | return $generator->generate_term( 'post_tag' ); 98 | } 99 | ); 100 | 101 | $attachment_keyword = $assoc_args['attachment-keyword']; 102 | $attachment_ids = generate_with_progress( 103 | 'attachment', 104 | (int) $assoc_args['attachments'], 105 | function( $i ) use ( $generator, $attachment_keyword ) { 106 | return $generator->generate_attachment( 640, 480, $attachment_keyword, "$attachment_keyword$i.jpg" ); 107 | } 108 | ); 109 | 110 | generate_with_progress( 111 | 'post', 112 | (int) $assoc_args['posts'], 113 | function() use ( $generator, $author_ids, $attachment_ids, $category_ids, $tag_ids ) { 114 | return $generator->generate_post( 'post', $author_ids, $attachment_ids, [], $category_ids, $tag_ids ); 115 | } 116 | ); 117 | 118 | generate_with_progress( 119 | 'page', 120 | (int) $assoc_args['pages'], 121 | function( $i, $ids ) use ( $generator, $author_ids, $attachment_ids, $category_ids, $tag_ids ) { 122 | return $generator->generate_post( 'page', $author_ids, $attachment_ids, $ids, $category_ids, $tag_ids ); 123 | } 124 | ); 125 | } 126 | } 127 | 128 | if ( class_exists( WP_CLI::class ) ) { 129 | WP_CLI::add_command( 'faker core', Core::class ); 130 | } 131 | -------------------------------------------------------------------------------- /src/factories/generator-factory.php: -------------------------------------------------------------------------------- 1 | generate_aioseo_fields( $post_id ); 65 | $this->insert_data_into_aioseo_table( $aioseo_fields ); 66 | $this->insert_aioseo_data_into_post_meta_table( $post_id, $aioseo_fields ); 67 | 68 | return $post_id; 69 | } 70 | 71 | /** 72 | * Generates random All-in-One SEO data in the form of an associative array 73 | * mapping AiOSEO field name to value. 74 | * 75 | * @param int $post_id The ID of the post to generate data for. 76 | * 77 | * @return array Generated AiOSEO data. 78 | */ 79 | private function generate_aioseo_fields( $post_id ) { 80 | $replace_vars = \array_merge( 81 | self::REPLACE_VARS, 82 | $this->get_custom_field_replace_vars( $post_id ) 83 | ); 84 | 85 | return [ 86 | // "id" => 0, // Auto increment 87 | "post_id" => $post_id, 88 | "title" => $this->generate_aioseo_text_with_replace_vars( $replace_vars ), 89 | "description" => $this->generate_aioseo_text_with_replace_vars( $replace_vars ), 90 | "og_title" => $this->generate_aioseo_text_with_replace_vars( $replace_vars ), 91 | "og_description" => $this->generate_aioseo_text_with_replace_vars( $replace_vars ), 92 | "twitter_title" => $this->generate_aioseo_text_with_replace_vars( $replace_vars ), 93 | "twitter_description" => $this->generate_aioseo_text_with_replace_vars( $replace_vars ), 94 | "keywords" => null, // We don't offer keywords functionality. 95 | /** 96 | * { 97 | * "focus":{ 98 | * "keyphrase":"Test", 99 | * "score": 0, // not important 100 | * "analysis": "" // not important 101 | * }, 102 | * "additional":[ 103 | * { 104 | * "keyphrase": "Additional", 105 | * "score": 0 // not important 106 | * "analysis": "" // not important 107 | * } 108 | * ] 109 | * } 110 | */ 111 | "keyphrases" => null, // JSON, see above. 112 | "page_analysis" => null, // JSON, Not important, since we can't use a different scoring mechanism. 113 | "canonical_url" => null, // string 114 | /** 115 | * See link for object types. 116 | * 117 | * https://github.com/awesomemotive/all-in-one-seo-pack/blob/4a4a5224a2ce3c87d2f6c154a487ea013119c551/src/vue/plugins/constants.js#L1158 118 | */ 119 | "og_object_type" => "default", // string 120 | /** 121 | * See link for image types. 122 | * 123 | * https://github.com/awesomemotive/all-in-one-seo-pack/blob/4a4a5224a2ce3c87d2f6c154a487ea013119c551/src/vue/mixins/Image.js#L53 124 | * 125 | * Special remarks: 126 | * - "custom" / Image from Custom Field (Saved in og_image_custom_fields) 127 | * - "custom_image" / Custom Image (Saved in og_image_custom_url) 128 | */ 129 | "og_image_type" => "default", // string 130 | "og_image_custom_url" => null, // string, value used as og:image when "custom_image" is selected as og_image_type 131 | "og_image_custom_fields" => null, // string, key of the custom field to be used as og:image when og_image_type "custom" is selected 132 | "og_custom_image_width" => 0, // int 133 | "og_custom_image_height" => 0, // int 134 | "og_video" => null, // ? 135 | "og_custom_url" => null, // ? 136 | "og_article_section" => "", // string, Output in a "article:section" metatag. 137 | /** 138 | * [ 139 | * { 140 | * "label":"tag1", 141 | * "value":"tag1" 142 | * }, 143 | * { 144 | * "label":"tag2", 145 | * "value":"tag2" 146 | * }, 147 | * ] 148 | */ 149 | "og_article_tags" => "", // JSON, each tag's value is output in a separate "article:tags" metatag. See above. 150 | "twitter_use_og" => 0, // Boolean, corresponds to the "Use Data from Facebook Tab" toggle on the twitter tab. 151 | /** 152 | * - "default" / Default (Set under Social Networks) 153 | * - "summary" / Summary 154 | * - "summary_large_image" / Summary with Large Image 155 | */ 156 | "twitter_card" => "default", 157 | "twitter_image_type" => "default", // Same options as og_image_type, see above. 158 | "twitter_image_custom_url" => null, // string, value used as twitter:image when "custom_image" is selected as twitter_image_type 159 | "twitter_image_custom_fields" => null, // string, key of the custom field to be used as twitter:image when twitter_image_type "custom" is selected 160 | "schema_type" => "default", // string 161 | /** 162 | * { 163 | * "article":{ 164 | * "articleType":"BlogPosting" 165 | * }, 166 | * "course":{ 167 | * "name":"", 168 | * "description":"", 169 | * "provider":"" 170 | * }, 171 | * "faq":{ 172 | * "pages":[ 173 | * 174 | * ] 175 | * }, 176 | * "product":{ 177 | * "reviews":[ 178 | * 179 | * ] 180 | * }, 181 | * "recipe":{ 182 | * "ingredients":[ 183 | * 184 | * ], 185 | * "instructions":[ 186 | * 187 | * ], 188 | * "keywords":[ 189 | * 190 | * ] 191 | * }, 192 | * "software":{ 193 | * "reviews":[ 194 | * 195 | * ], 196 | * "operatingSystems":[ 197 | * 198 | * ] 199 | * }, 200 | * "webPage":{ 201 | * "webPageType":"WebPage" 202 | * } 203 | * } 204 | */ 205 | "schema_type_options" => null, // JSON, See above. 206 | "pillar_content" => 0, // Boolean 207 | "robots_default" => 1, // Boolean, whether or not to use default robots settings. 208 | "robots_noindex" => 0, // Boolean 209 | "robots_noarchive" => 0, // Boolean 210 | "robots_nosnippet" => 0, // Boolean 211 | "robots_nofollow" => 0, // Boolean 212 | "robots_noimageindex" => 0, // Boolean 213 | "robots_noodp" => 0, // Boolean 214 | "robots_notranslate" => 0, // Boolean 215 | "robots_max_snippet" => -1, // int 216 | "robots_max_videopreview" => -1, // int 217 | "robots_max_imagepreview" => "large", // string 218 | "tabs" => null, // JSON 219 | "images" => null, // JSON, Array of images with metadata in the post. 220 | "priority" => "default", // string 221 | "image_scan_date" => null, // Date string 222 | "frequency" => "default", // string 223 | "videos" => null, // JSON, Array of videos with metadata in the post. 224 | "video_scan_date" => null, // Date string 225 | // "created" => null, // Date string, defaults to current date 226 | // "updated" => null, // Date string, defaults to current date 227 | ]; 228 | } 229 | 230 | /** 231 | * Inserts the given generated All-in-One SEO data into their 232 | * own purposefully built database table. 233 | * 234 | * @param array $aioseo_data The generated AiOSEO data. 235 | * 236 | * @return void 237 | */ 238 | private function insert_data_into_aioseo_table( $aioseo_data ) { 239 | global $wpdb; 240 | 241 | $wpdb->query( 242 | $wpdb->prepare( 243 | " 244 | INSERT INTO {$wpdb->prefix}aioseo_posts 245 | (" . \implode( ",", \array_keys( $aioseo_data ) ) . ") 246 | VALUES 247 | (" . \implode( ', ', \array_fill( 0, count( $aioseo_data ), '%s' ) ) . ") 248 | ", 249 | \array_values( $aioseo_data ) 250 | ) 251 | ); 252 | } 253 | 254 | /** 255 | * Inserts the given All-in-One SEO data into the post meta table. 256 | * 257 | * @param int $post_id The ID of the post to insert the data for. 258 | * @param array $aioseo_data The AiOSEO data to insert. 259 | * 260 | * @return void 261 | */ 262 | private function insert_aioseo_data_into_post_meta_table( $post_id, $aioseo_data ) { 263 | foreach ( self::META_KEYS as $meta_key ) { 264 | $db_key = str_replace( "_aioseo_", "", $meta_key ); 265 | 266 | \add_post_meta( $post_id, $meta_key, $aioseo_data[ $db_key ] ); 267 | } 268 | } 269 | 270 | /** 271 | * Creates a list of AIOSEO replacement variables for the post's custom fields. 272 | * 273 | * @param int $post_id The post id. 274 | * 275 | * @return string[] List of AIOSEO replacement variables for custom fields. 276 | */ 277 | private function get_custom_field_replace_vars( $post_id ) { 278 | $custom_field_keys = \array_filter( 279 | \get_post_custom_keys( $post_id ), 280 | static function( $key ) { 281 | return \strpos( $key, self::$custom_field_prefix ) === 0; 282 | } 283 | ); 284 | 285 | return \array_map( 286 | static function( $key ) { 287 | return '#custom_field-' . $key; 288 | }, 289 | $custom_field_keys 290 | ); 291 | } 292 | 293 | /** 294 | * Generates a random title or description using AIOSEO replacement variables. 295 | * 296 | * @param array $replace_vars Array of replacevars to use. 297 | * 298 | * @return string The generated replacevar string. 299 | */ 300 | private function generate_aioseo_text_with_replace_vars( $replace_vars ) { 301 | $items = \array_merge( $this->faker->words( 12 ), $replace_vars ); 302 | return \implode( ' ', $this->faker->randomElements( $items, $this->faker->numberBetween( 2, 5 ) ) ); 303 | } 304 | } 305 | -------------------------------------------------------------------------------- /src/generators/core-generator.php: -------------------------------------------------------------------------------- 1 | faker = $faker; 31 | } 32 | 33 | /** 34 | * Generates a user. 35 | * 36 | * @param string $role The role of the user. 37 | * 38 | * @return int The user id. 39 | * 40 | * @throws Exception If the user could not be saved. 41 | */ 42 | public function generate_user( $role = 'author' ) { 43 | $author_id = \wp_insert_user( 44 | [ 45 | 'user_login' => $this->faker->unique()->userName, 46 | 'user_pass' => $this->faker->password, 47 | 'user_url' => $this->faker->url, 48 | 'user_email' => $this->faker->email, 49 | 'first_name' => $this->faker->firstName, 50 | 'last_name' => $this->faker->lastName, 51 | 'description' => $this->faker->paragraph, 52 | 'user_registered' => $this->faker->dateTimeThisCentury->format( 'Y-m-d H:i:s' ), 53 | 'role' => $role, 54 | ] 55 | ); 56 | 57 | if ( is_wp_error( $author_id ) ) { 58 | throw new Exception( $author_id->get_error_message() ); 59 | } 60 | 61 | return $author_id; 62 | } 63 | 64 | /** 65 | * Generates an attachment. 66 | * 67 | * @param int $width They width of the image. 68 | * @param int $height The height of the image. 69 | * @param string $keyword The keyword to search loremflicker.com for. 70 | * @param string $file_name The file name to save the image as. 71 | * 72 | * @return int The attachment id. 73 | * 74 | * @throws Exception If the image could not be downloaded or saved. 75 | */ 76 | public function generate_attachment( $width, $height, $keyword, $file_name ) { 77 | $file_array = []; 78 | $file_array['name'] = $file_name; 79 | 80 | // Download file to temp location. 81 | $file_array['tmp_name'] = download_url( "https://loremflickr.com/$width/$height/$keyword" ); 82 | if ( is_wp_error( $file_array['tmp_name'] ) ) { 83 | throw new Exception( $file_array['tmp_name']->get_error_message() ); 84 | } 85 | 86 | // Do the validation and storage stuff. 87 | $attachment_id = media_handle_sideload( $file_array, 0, null ); 88 | 89 | if ( is_wp_error( $attachment_id ) ) { 90 | throw new Exception( $attachment_id->get_error_message() ); 91 | } 92 | 93 | return $attachment_id; 94 | } 95 | 96 | /** 97 | * Generates a term 98 | * 99 | * @param string $taxonomy The taxonomy of the term. 100 | * @param array $parent_ids Optional. The list of possible parent ids. 50% a random one will be assigned. 101 | * 102 | * @return int The term id. 103 | * 104 | * @throws Exception If the term could not be saved. 105 | */ 106 | public function generate_term( $taxonomy, $parent_ids = [] ) { 107 | $category = \wp_insert_term( 108 | $this->faker->unique()->catchPhrase, 109 | $taxonomy, 110 | [ 111 | 'description' => $this->faker->paragraph, 112 | 'parent' => ( $this->faker->boolean && count( $parent_ids ) > 0 ) ? $this->faker->randomElement( $parent_ids ) : null, 113 | ] 114 | ); 115 | 116 | if ( \is_wp_error( $category ) ) { 117 | throw new Exception( $category->get_error_message() ); 118 | } 119 | 120 | return $category['term_id']; 121 | } 122 | 123 | /** 124 | * Generates a post. 125 | * 126 | * @param string $post_type The post type. 127 | * @param int[] $author_ids The possible author ids. 128 | * @param int[] $attachment_ids The possible attachment ids. 129 | * @param int[] $parent_ids The possible parent ids. 130 | * @param int[] $category_ids The possible category ids. 131 | * @param int[] $tag_ids The possible tag ids. 132 | * 133 | * @return int The post id. 134 | * 135 | * @throws Exception If the post could not be saved. 136 | */ 137 | public function generate_post( $post_type, $author_ids, $attachment_ids, $parent_ids, $category_ids, $tag_ids ) { 138 | $date = $this->faker->dateTimeThisYear(); 139 | $post_id = \wp_insert_post( 140 | [ 141 | 'post_author' => $this->faker->randomElement( $author_ids ), 142 | 'post_date' => $date->format( 'Y-m-d H:i:s' ), 143 | 'post_content' => $this->generate_post_content( $attachment_ids ), 144 | 'post_title' => $this->faker->catchPhrase, 145 | 'post_type' => $post_type, 146 | 'post_status' => 'publish', 147 | 'post_parent' => ( $this->faker->boolean( 25 ) && count( $parent_ids ) > 0 ) ? $this->faker->randomElement( $parent_ids ) : null, 148 | 'post_modified' => ( ( $this->faker->boolean ) ? $this->faker->dateTimeBetween( $date ) : $date )->format( 'Y-m-d H:i:s' ), 149 | 'post_category' => $this->faker->randomElements( $category_ids, $this->faker->numberBetween( 1, 2 ) ), 150 | 'tags_input' => $this->faker->randomElements( $tag_ids, $this->faker->numberBetween( 0, 4 ) ), 151 | 'meta_input' => $this->generate_custom_fields(), 152 | ] 153 | ); 154 | 155 | if ( \is_wp_error( $post_id ) ) { 156 | throw new Exception( $post_id->get_error_message() ); 157 | } 158 | 159 | \set_post_thumbnail( $post_id, $this->faker->randomElement( $attachment_ids ) ); 160 | 161 | return $post_id; 162 | } 163 | 164 | /** 165 | * Generates post content. 166 | * 167 | * @param int[] $attachment_ids The possible attachment ids. 168 | * 169 | * @return string The post content. 170 | */ 171 | public function generate_post_content( $attachment_ids ) { 172 | $blocks = []; 173 | $block_count = $this->faker->numberBetween( 8, 12 ); 174 | 175 | for ( $i = 0; $i < $block_count; $i++ ) { 176 | if ( $this->faker->boolean( 90 ) ) { 177 | $blocks[] = "\n

" . $this->faker->paragraph . "

\n"; 178 | continue; 179 | } 180 | 181 | $attachment_id = $this->faker->randomElement( $attachment_ids ); 182 | $attachment_url = wp_get_attachment_url( $attachment_id ); 183 | $blocks[] = "\n
\"\"
\n"; 184 | } 185 | 186 | return implode( "\n", $blocks ); 187 | } 188 | 189 | /** 190 | * Generates custom fields with random words as a value. 191 | * 192 | * @return string[] The array of generate custom fields. 193 | */ 194 | public function generate_custom_fields() { 195 | if ( count( self::$custom_field_keys ) === 0 ) { 196 | for ( $i = 0; $i < 10; $i++ ) { 197 | self::$custom_field_keys[] = self::$custom_field_prefix . $this->faker->word; 198 | } 199 | } 200 | 201 | $custom_fields = []; 202 | foreach ( self::$custom_field_keys as $key ) { 203 | $custom_fields[ $key ] = $this->faker->word; 204 | } 205 | 206 | return $custom_fields; 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /src/generators/woocommerce-generator.php: -------------------------------------------------------------------------------- 1 | faker = $faker; 28 | $this->core_generator = $core_generator; 29 | } 30 | 31 | /** 32 | * Generates a review 33 | * 34 | * @param int $product_id The product id. 35 | * 36 | * @return int The review id. 37 | * 38 | * @throws Exception If the review could not be saved. 39 | */ 40 | public function generate_review( $product_id ) { 41 | $controller = new \WC_REST_Product_Reviews_Controller(); 42 | 43 | $params = [ 44 | 'product_id' => $product_id, 45 | 'review' => $this->faker->paragraph, 46 | 'reviewer' => $this->faker->name, 47 | 'reviewer_email' => $this->faker->email, 48 | 'rating' => $this->faker->numberBetween( 0, 5 ), 49 | 'verified' => $this->faker->boolean, 50 | ]; 51 | $request = new \WP_REST_Request( 'POST' ); 52 | $request->set_body_params( $params ); 53 | 54 | $response = $controller->create_item( $request ); 55 | 56 | if ( \is_wp_error( $response ) ) { 57 | throw new Exception( $response->get_error_message() ); 58 | } 59 | 60 | return $response->data['id']; 61 | } 62 | 63 | /** 64 | * Generates a product category 65 | * 66 | * @param int[] $attachment_ids The possible attachment ids. 67 | * 68 | * @return int The product category id. 69 | * 70 | * @throws Exception If the product category could not be saved. 71 | */ 72 | public function generate_category( $attachment_ids ) { 73 | $controller = new \WC_REST_Product_Categories_Controller(); 74 | 75 | $params = [ 76 | 'name' => $this->faker->unique()->catchPhrase, 77 | 'description' => $this->core_generator->generate_post_content( $attachment_ids ), 78 | 'image' => [ 'id' => $this->faker->randomElement( $attachment_ids ) ], 79 | ]; 80 | $request = new \WP_REST_Request( 'POST' ); 81 | $request->set_body_params( $params ); 82 | 83 | $response = $controller->create_item( $request ); 84 | 85 | if ( \is_wp_error( $response ) ) { 86 | throw new Exception( $response->get_error_message() ); 87 | } 88 | 89 | return $response->data['id']; 90 | } 91 | 92 | /** 93 | * Generates a product 94 | * 95 | * @param int[] $attachment_ids The possible attachment ids. 96 | * @param int[] $category_ids The possible category ids. 97 | * @param int[] $brand_ids The possible brand ids. 98 | * 99 | * @return int The product id. 100 | * 101 | * @throws Exception If the product could not be saved. 102 | */ 103 | public function generate_product( $attachment_ids, $category_ids, $brand_ids ) { 104 | $controller = new \WC_REST_Products_Controller(); 105 | 106 | $params = [ 107 | 'name' => $this->faker->unique()->catchPhrase, 108 | 'description' => $this->core_generator->generate_post_content( $attachment_ids ), 109 | 'status' => 'publish', 110 | 'type' => 'Simple', 111 | 'featured' => $this->faker->boolean( 10 ), 112 | 'sku' => $this->faker->numerify( '######' ), 113 | 'regular_price' => $this->faker->numberBetween( 10, 100 ), 114 | 'images' => [], 115 | 'categories' => [], 116 | ]; 117 | 118 | $number_of_images = $this->faker->numberBetween( 1, 3 ); 119 | for ( $i = 0; $i < $number_of_images; $i++ ) { 120 | $params['images'][] = [ 'id' => $this->faker->randomElement( $attachment_ids ) ]; 121 | } 122 | 123 | $number_of_categories = $this->faker->numberBetween( 1, 2 ); 124 | for ( $i = 0; $i < $number_of_categories; $i++ ) { 125 | $params['categories'][] = [ 'id' => $this->faker->randomElement( $category_ids ) ]; 126 | } 127 | 128 | $number_of_brands = $this->faker->numberBetween( 1, 2 ); 129 | $params['brands'] = $this->faker->randomElements( $brand_ids, $number_of_brands ); 130 | 131 | $request = new \WP_REST_Request( 'POST' ); 132 | $request->set_body_params( $params ); 133 | $response = $controller->create_item( $request ); 134 | 135 | if ( \is_wp_error( $response ) ) { 136 | throw new Exception( $response->get_error_message() ); 137 | } 138 | 139 | return $response->data['id']; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /src/helper-functions.php: -------------------------------------------------------------------------------- 1 | getMessage() ); 27 | } 28 | $progress->tick(); 29 | } 30 | $progress->finish(); 31 | 32 | return $ids; 33 | } 34 | -------------------------------------------------------------------------------- /src/woocommerce.php: -------------------------------------------------------------------------------- 1 | ] 21 | * : The number of attachments to generate. 22 | * --- 23 | * default: 10 24 | * --- 25 | * 26 | * [--attachment-keyword=] 27 | * : The keyword used to generate attachments. 28 | * --- 29 | * default: jewelry 30 | * --- 31 | * 32 | * [--categories=] 33 | * : The number of categories to generate. 34 | * --- 35 | * default: 25 36 | * --- 37 | * 38 | * [--brands=] 39 | * : The number of brands to generate. 40 | * --- 41 | * default: 25 42 | * --- 43 | * 44 | * [--products=] 45 | * : The number of products to generate. 46 | * --- 47 | * default: 300 48 | * --- 49 | * 50 | * [--min-reviews=] 51 | * : The minimum number of reviews to generate. 52 | * --- 53 | * default: 3 54 | * --- 55 | * 56 | * [--max-reviews=] 57 | * : The maximum number of reviews to generate. 58 | * --- 59 | * default: 8 60 | * --- 61 | * 62 | * ## EXAMPLES 63 | * 64 | * wp faker woocommerce products 65 | * 66 | * @when after_wp_load 67 | * 68 | * @param string[] $args The command line arguments. 69 | * @param array $assoc_args The associative command line arguments. 70 | */ 71 | public function products( $args, $assoc_args ) { 72 | $faker = Factory::create(); 73 | $core_generator = new Core_Generator( $faker ); 74 | $woo_generator = new WooCommerce_Generator( $faker, $core_generator ); 75 | 76 | $attachment_keyword = $assoc_args['attachment-keyword']; 77 | $attachment_ids = generate_with_progress( 78 | 'attachment', 79 | (int) $assoc_args['attachments'], 80 | function( $i ) use ( $core_generator, $attachment_keyword ) { 81 | return $core_generator->generate_attachment( 640, 480, $attachment_keyword, "$attachment_keyword$i.jpg" ); 82 | } 83 | ); 84 | 85 | $category_ids = generate_with_progress( 86 | 'product category', 87 | (int) $assoc_args['categories'], 88 | function() use ( $woo_generator, $attachment_ids ) { 89 | return $woo_generator->generate_category( $attachment_ids ); 90 | } 91 | ); 92 | 93 | $brand_ids = []; 94 | if ( \taxonomy_exists( 'pwb-brand' ) ) { 95 | $brand_ids = generate_with_progress( 96 | 'brand', 97 | (int) $assoc_args['brands'], 98 | function() use ( $core_generator, $faker, $attachment_ids ) { 99 | $id = $core_generator->generate_term( 'pwb-brand' ); 100 | \update_term_meta( $id, 'pwb_brand_image', $faker->randomElement( $attachment_ids ) ); 101 | return $id; 102 | } 103 | ); 104 | } 105 | 106 | $product_ids = generate_with_progress( 107 | 'product', 108 | (int) $assoc_args['products'], 109 | function() use ( $woo_generator, $attachment_ids, $category_ids, $brand_ids ) { 110 | return $woo_generator->generate_product( $attachment_ids, $category_ids, $brand_ids ); 111 | } 112 | ); 113 | 114 | add_filter( 'wp_is_comment_flood', '__return_false', PHP_INT_MAX ); 115 | add_filter( 'pre_comment_approved', '__return_true' ); 116 | generate_with_progress( 117 | 'reviews', 118 | (int) $assoc_args['products'], 119 | function( $i ) use ( $woo_generator, $faker, $product_ids, $assoc_args ) { 120 | $review_ids = []; 121 | $number_of_reviews = $faker->numberBetween( $assoc_args['min-reviews'], $assoc_args['max-reviews'] ); 122 | for ( $i = 0; $i < $number_of_reviews; $i++ ) { 123 | $review_ids[] = $woo_generator->generate_review( $product_ids[ $i ] ); 124 | } 125 | return $review_ids; 126 | } 127 | ); 128 | remove_filter( 'wp_is_comment_flood', '__return_false', PHP_INT_MAX ); 129 | remove_filter( 'pre_comment_approved', '__return_true' ); 130 | } 131 | } 132 | 133 | if ( class_exists( WP_CLI::class ) ) { 134 | WP_CLI::add_command( 'faker woocommerce', WooCommerce::class ); 135 | } 136 | -------------------------------------------------------------------------------- /wp-cli-faker.php: -------------------------------------------------------------------------------- 1 |