{"id":16173472,"url":"https://github.com/robdwaller/atlantic-city","last_synced_at":"2026-03-11T05:30:54.340Z","repository":{"id":56070102,"uuid":"171491321","full_name":"RobDWaller/atlantic-city","owner":"RobDWaller","description":"A Composer based WordPress plugin which displays lyrics from the song Atlantic City in the WordPress admin.","archived":false,"fork":false,"pushed_at":"2020-11-27T09:21:44.000Z","size":32,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-02T20:44:42.592Z","etag":null,"topics":["composer","composer-package","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobDWaller.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-19T14:46:28.000Z","updated_at":"2022-03-16T00:04:33.000Z","dependencies_parsed_at":"2022-08-15T12:40:11.825Z","dependency_job_id":null,"html_url":"https://github.com/RobDWaller/atlantic-city","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/RobDWaller/atlantic-city","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobDWaller%2Fatlantic-city","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobDWaller%2Fatlantic-city/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobDWaller%2Fatlantic-city/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobDWaller%2Fatlantic-city/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobDWaller","download_url":"https://codeload.github.com/RobDWaller/atlantic-city/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobDWaller%2Fatlantic-city/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260826835,"owners_count":23068852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","composer-package","wordpress","wordpress-plugin"],"created_at":"2024-10-10T04:08:50.417Z","updated_at":"2026-03-11T05:30:54.315Z","avatar_url":"https://github.com/RobDWaller.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Atlantic City\n\n[![Actions Status](https://github.com/robdwaller/atlantic-city/workflows/ci/badge.svg)](https://github.com/robdwaller/atlantic-city/actions) [![codecov](https://codecov.io/gh/RobDWaller/atlantic-city/branch/master/graph/badge.svg)](https://codecov.io/gh/RobDWaller/atlantic-city) ![PHP Version Support](https://img.shields.io/packagist/php-v/rbdwllr/atlantic-city)\n\nA Composer based WordPress plugin which displays lyrics from the song [Atlantic City](https://en.wikipedia.org/wiki/Atlantic_City_(song)) in the WordPress admin.\n\nThis plugin was created to show developers how to create WordPress plugins which are hosted on [Packagist](https://packagist.org/) and work with Composer friendly WordPress frameworks like [Dusty](https://packagist.org/packages/rbdwllr/dusty).\n\nIt also highlights how to write unit tests for WordPress plugins using [WP_Mock](https://packagist.org/packages/10up/wp_mock) and how to integrate with static analysis tools like [PHPStan](https://packagist.org/packages/phpstan/phpstan).\n\n## Composer Setup\n\nThere is only one difference between a WordPress plugin built with Composer compared to a standard PHP package, which is the package type. With WordPress plugins you set the type to `wordpress-plugin` in the [Composer.json file](https://github.com/RobDWaller/atlantic-city/blob/master/composer.json).\n\n```json\n\"type\": \"wordpress-plugin\",\n```\n\nThis simply tells Composer friendly WordPress frameworks how to handle the package, instead of putting the package in the vendor folder it will put the package in the WordPress plugins directory. See [WPackagist](https://wpackagist.org/) for more details on this.\n\n## Unit Tests with WP_Mock\n\nTo write unit tests for WordPress you need to use a package called [WP_Mock](https://packagist.org/packages/10up/wp_mock). It is an extension of PHP Unit which allows you to mock WordPress custom function calls.\n\nFor instance this library's [unit tests](https://github.com/RobDWaller/atlantic-city/blob/master/tests/AtlanticCityTest.php) mock the `is_rtl()` function which tells WordPress if the site's text runs from right to left or left to right.\n\n```php\nWP_Mock::userFunction('is_rtl', [\n    'times' =\u003e 1,\n    'return' =\u003e false\n]);\n```\n\nTo use WP_Mock you need to create a custom [bootstrap file](https://github.com/RobDWaller/atlantic-city/blob/master/tests/bootstrap.php) and extend the WP_Mock test case class rather than the PHP Unit one.\n\n```php\nnamespace Tests;\n\nuse App\\MyWordPressCode;\nuse WP_Mock\\Tools\\TestCase;\nuse WP_Mock;\n\nclass MyWordPressTests extends TestCase\n{\n    ...\n}\n```\n\nWP_Mock also comes with some nice features which allow you to check whether WordPress actions or filters have been called.\n\n```php\nWP_Mock::expectActionAdded('action', 'parameters');\n```\n\n## Other Code Analysis Tools\n\nThis plugin integrates with a number of static analysis tools, including [PHP Code Sniffer](https://packagist.org/packages/squizlabs/php_codesniffer) and [PHP Mess Detection](https://packagist.org/packages/phpmd/phpmd), which will help improve the code quality of the WordPress plugins you produce.\n\nIt also shows you how to integrate with [PHPStan](https://phpstan.org) to add some type safety to your code. This requires a small amount of customisation to handle WordPress so there is a [configuration file](/phpstan.neon.dist) and an integration with the [szepeviktor/phpstan-wordpress](https://packagist.org/packages/szepeviktor/phpstan-wordpress) package which extends PHPStan for WordPress.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobdwaller%2Fatlantic-city","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobdwaller%2Fatlantic-city","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobdwaller%2Fatlantic-city/lists"}