{"id":23908490,"url":"https://github.com/robertdevore/wpcom-check","last_synced_at":"2026-03-05T19:32:24.347Z","repository":{"id":270781457,"uuid":"911440229","full_name":"robertdevore/wpcom-check","owner":"robertdevore","description":"A utility to handle WordPress.com-specific plugin compatibility and auto-deactivation.","archived":false,"fork":false,"pushed_at":"2025-02-04T02:21:25.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T05:40:30.809Z","etag":null,"topics":[],"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/robertdevore.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-03T02:59:36.000Z","updated_at":"2025-02-04T02:21:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"db88adec-bd12-4173-8217-906043d88030","html_url":"https://github.com/robertdevore/wpcom-check","commit_stats":null,"previous_names":["robertdevore/wpcom-check"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fwpcom-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fwpcom-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fwpcom-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fwpcom-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdevore","download_url":"https://codeload.github.com/robertdevore/wpcom-check/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249141749,"owners_count":21219546,"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":[],"created_at":"2025-01-05T04:37:59.775Z","updated_at":"2026-03-05T19:32:18.422Z","avatar_url":"https://github.com/robertdevore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WPCom Check\n\nWPCom Check is a WordPress® utility designed to ensure compatibility with WordPress.com-hosted environments. \n\nIt provides automated plugin deactivation and user notifications if a plugin is not supported on WordPress.com. \n\nThis tool is ideal for plugin developers who want to ensure their plugins gracefully handle unsupported hosting environments.\n\n## Features\n\n- Automatically detects if the site is hosted on WordPress.com.\n- Deactivates the plugin if unsupported.\n- Displays an admin notice with information about the deactivation.\n- Prevents activation on unsupported environments.\n- Allows developers to provide a custom learn-more link for user education.\n\n## Installation\n\n### Using Composer\n\nAdd the package to your project:\n\n```\ncomposer require robertdevore/wpcom-check\n```\n\nInclude Composer's autoload file in your plugin or theme:\n\n```\nif ( ! class_exists( 'RobertDevore\\WPComCheck\\WPComPluginHandler' ) ) {\n    require_once __DIR__ . '/vendor/autoload.php';\n}\n```\n\nInstantiate the `WPComPluginHandler` class in your plugin's main file:\n\n```\nuse RobertDevore\\WPComCheck\\WPComPluginHandler;\n\nnew WPComPluginHandler( plugin_basename( __FILE__ ), 'https://domain.com/learn-more/' );\n```\n\n### Manual Installation\n\nClone or download the repository from GitHub:\n\n```\ngit clone https://github.com/robertdevore/wpcom-check.git\n```\n\nInclude the `WPComPluginHandler.php` file in your project:\n\n```\nif ( ! class_exists( 'RobertDevore\\WPComCheck\\WPComPluginHandler' ) ) {\n    require_once __DIR__ . '/vendor/autoload.php';\n}\n```\n\nInstantiate the class in your plugin's main file:\n\n```\nuse RobertDevore\\WPComCheck\\WPComPluginHandler;\n\nnew WPComPluginHandler( plugin_basename( __FILE__ ), 'https://domain.com/learn-more/' );\n```\n\n## Usage\n\n### Parameters\n\n- `**$pluginSlug**`: (string) The plugin slug, typically obtained using `plugin_basename(__FILE__)`.\n- `**$learnMoreLink**`: (string) A URL pointing to more information about the deactivation reason or alternative solutions.\n\n### Example\n\nHere is how to use WPCom Check in your plugin:\n```\n\u003c?php\n/**\n * Plugin Name: My Awesome Plugin\n */\n\nif ( ! class_exists( 'RobertDevore\\WPComCheck\\WPComPluginHandler' ) ) {\n    require_once __DIR__ . '/vendor/autoload.php';\n}\n\nuse RobertDevore\\WPComCheck\\WPComPluginHandler;\n\nnew WPComPluginHandler( plugin_basename( __FILE__ ), 'https://domain.com/learn-more/' );\n```\n\n## How It Works\n\n1. **Detection**: The `WPComPluginHandler` checks if the site is hosted on WordPress.com by inspecting the `IS_WPCOM`constant.\n\n2. **Deactivation**: If the plugin is running in an unsupported environment, it is deactivated automatically.\n\n3. **Admin Notice**: An admin notice is displayed, providing users with a link to learn more about the issue.\n\n4. **Activation Prevention**: The plugin prevents itself from being activated on unsupported environments, displaying a detailed error message.\n\n## Developer Notes\n\n- Ensure you use the correct plugin slug when instantiating the class.\n- Customize the learn-more link to provide users with appropriate guidance.\n- Use Composer for a streamlined installation and updates.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your improvements.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Support\n\nFor questions or issues, please create a GitHub issue at [github.com/robertdevore/wpcom-check](https://github.com/robertdevore/wpcom-check/issues).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdevore%2Fwpcom-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdevore%2Fwpcom-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdevore%2Fwpcom-check/lists"}