{"id":15374467,"url":"https://github.com/warengonzaga/managewp-code-snippets","last_synced_at":"2026-03-08T05:34:23.397Z","repository":{"id":92763668,"uuid":"284425878","full_name":"warengonzaga/managewp-code-snippets","owner":"warengonzaga","description":"ManageWP Code Snippets Collections","archived":false,"fork":false,"pushed_at":"2021-03-06T11:27:56.000Z","size":6,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-28T18:33:40.589Z","etag":null,"topics":["code","collections","debugging","debugging-tool","list","maintenance","managewp","php","snippets","snippets-collections","source","wordpress"],"latest_commit_sha":null,"homepage":"","language":null,"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/warengonzaga.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}},"created_at":"2020-08-02T08:56:24.000Z","updated_at":"2024-07-10T13:52:10.000Z","dependencies_parsed_at":"2023-03-14T23:30:54.457Z","dependency_job_id":null,"html_url":"https://github.com/warengonzaga/managewp-code-snippets","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.19999999999999996","last_synced_commit":"e40d1f6cd52145d78bfaade128cc36be1f2aab71"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/warengonzaga/managewp-code-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warengonzaga%2Fmanagewp-code-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warengonzaga%2Fmanagewp-code-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warengonzaga%2Fmanagewp-code-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warengonzaga%2Fmanagewp-code-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warengonzaga","download_url":"https://codeload.github.com/warengonzaga/managewp-code-snippets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warengonzaga%2Fmanagewp-code-snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30246752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["code","collections","debugging","debugging-tool","list","maintenance","managewp","php","snippets","snippets-collections","source","wordpress"],"created_at":"2024-10-01T13:58:51.138Z","updated_at":"2026-03-08T05:34:18.382Z","avatar_url":"https://github.com/warengonzaga.png","language":null,"funding_links":["https://paypal.me/warengonzagaofficial"],"categories":[],"sub_categories":[],"readme":"# ManageWP Code Snippets [![Maintained by Waren Gonzaga](https://img.shields.io/badge/Maintained%20by-Waren%20Gonzaga-blue.svg?longCache=true\u0026style=for-the-badge)](https://facebook.com/warengonzagaofficial)\n\nManageWP code snippets collection for WordPress.\n\n## How To Use\n\nJust copy and paste the available code snippets below and load it to your ManageWP code snippets editor.\n\n## Code Snippets\n\nHere's the collections of code snippets.\n\n### Info \u0026 Debugging\n\n* __List Plugins__ - This will list all of the available plugin in the WordPress plugin directory. Useful to check the installed plugins in your installation.\n\n    ```php\n    \u003c?php\n\n    // Directory to scan\n    $files = scandir(\"wp-content/plugins\");\n\n    // Return the result of the scan\n    foreach($files as $file) {\n        echo $file.\"\\n\";\n    }\n    ```\n\n* __Test Database Connection__ - This will return a database connection status. This is useful to when you want to make sure your database credentials are working correctly or not.\n\n    ```php\n    \u003c?php\n\n    // Test Database Connection\n    $servername = \"localhost\";\n    $username = \"username-here\";\n    $password = \"password-here\";\n\n    // Create connection\n    $conn = new mysqli($servername, $username, $password);\n\n    // Check connection\n    if ($conn-\u003econnect_error) {\n        die(\"Connection failed: \" . $conn-\u003econnect_error);\n    }\n    echo \"Connected successfully\";\n    ```\n\n* __View File Contents__ - Able to view file contents in your installation. For example, you want to check the wp-config.php contents.\n\n    ```php\n    \u003c?php\n\n    // define specific file\n    $file = \"./wp-config.php\";\n\n    // do the magic\n    $view = file_get_contents($file, true);\n\n    // return the results\n    echo $view;\n    ```\n\n* __Check Free Disk Space__ - This will return the total free disk space on your web server.\n\n    ```php\n    \u003c?php\n\n    // checking disk space\n    $bytes = disk_free_space(\".\");\n\n    // setting up arraw for prefix\n    $si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );\n\n    // do the magic with math!\n    $base = 1024;\n    $class = min((int)log($bytes , $base) , count($si_prefix) - 1);\n\n    // return the result\n    echo \"Remaining disk space is \" . sprintf('%1.2f' , $bytes / pow($base,$class)) . ' ' . $si_prefix[$class];\n    ```\n\n## Contributing\n\nContributions are welcome, create a pull request to this repo and I will review your code. Please consider to submit your pull request to the ```dev``` branch. Thank you!\n\n## Issues\n\nIf you're facing any problems with the code snippets please let me know by creating an issue to this repository. Thank you!\n\n## To Do\n\n* Add more code snippets\n\n## Community\n\nWanna see other projects I made? Join today!\n\n[![Community](https://discordapp.com/api/guilds/659684980137656340/widget.png?style=banner3)](https://wrngnz.ga/discord)\n\n## Donate or Support\n\nIf you love this collection please consider to donate or support the maintainer.\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=for-the-badge)](https://paypal.me/warengonzagaofficial) [![Support](https://img.shields.io/badge/Support-Buy%20Me%20A%20Coffee-orange.svg?style=for-the-badge)](https://buymeacoff.ee/warengonzaga)\n\n## License\n\nManageWP Code Snippets is licensed under MIT - \u003chttps://opensource.org/licenses/MIT\u003e\n\n## Author\n\nManageWP Code Snippets is Maintained by **[Waren Gonzaga](https://github.com/warengonzaga)**\n\n[![Facebook](https://img.shields.io/badge/facebook-%231877F2.svg?\u0026style=for-the-badge\u0026logo=facebook\u0026logoColor=white)](https://facebook.com/warengonzagaofficial) [![Twitter](https://img.shields.io/badge/twitter-%231DA1F2.svg?\u0026style=for-the-badge\u0026logo=twitter\u0026logoColor=white)](https://twitter.com/warengonzaga) [![LinkedIn](https://img.shields.io/badge/linkedin-%230077B5.svg?\u0026style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://linkedin.com/in/warengonzagaofficial) [![YouTube](https://img.shields.io/badge/youtube-%23FF0000.svg?\u0026style=for-the-badge\u0026logo=youtube\u0026logoColor=white)](https://youtube.com/warengonzaga)\n\n---\n\n:computer: Made with :heart: by Waren Gonzaga with **YHWH** :pray:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarengonzaga%2Fmanagewp-code-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarengonzaga%2Fmanagewp-code-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarengonzaga%2Fmanagewp-code-snippets/lists"}