{"id":22349368,"url":"https://github.com/parsakafi/wp-meta-optimizer","last_synced_at":"2025-07-30T06:31:21.891Z","repository":{"id":45263413,"uuid":"508458730","full_name":"parsakafi/wp-meta-optimizer","owner":"parsakafi","description":"Meta Optimizer a WordPress plugin that helps your website load faster if you use more meta like Post/Comment/User/Term metas!","archived":false,"fork":false,"pushed_at":"2024-05-18T15:43:38.000Z","size":1669,"stargazers_count":27,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-18T16:40:11.925Z","etag":null,"topics":["wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parsakafi.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":"2022-06-28T21:21:22.000Z","updated_at":"2024-05-18T15:43:41.000Z","dependencies_parsed_at":"2024-05-18T16:50:03.622Z","dependency_job_id":null,"html_url":"https://github.com/parsakafi/wp-meta-optimizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fwp-meta-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fwp-meta-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fwp-meta-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parsakafi%2Fwp-meta-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parsakafi","download_url":"https://codeload.github.com/parsakafi/wp-meta-optimizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228098345,"owners_count":17869032,"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":["wordpress","wordpress-plugin"],"created_at":"2024-12-04T11:08:03.538Z","updated_at":"2024-12-04T11:08:04.311Z","avatar_url":"https://github.com/parsakafi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meta Optimizer\n\nThis plugin optimizes WordPress meta data storage by saving all meta data for each post, comment, user, or term in a\nsingle row with separate columns for each meta key. This reduces the number of rows and improves the query performance\nand data export. The plugin works seamlessly with WordPress core functions and hooks, and supports any plugins that use\nthem. Some of the features of this plugin are:\n\n- Custom database tables for each type of meta data (post, comment, user, term)\n- Compatibility with WordPress queries\n- Faster queries and easy data export\n- Data migration from default WordPress meta tables\n- Option to exclude specific fields from core meta tables\n- Support for popular plugins and themes such as Advanced Custom Fields, Meta Box, CMB2, and more.\n\n# Download\n\n[Download stable version from WordPress.org](https://wordpress.org/plugins/meta-optimizer/)\n\u0026nbsp;\n\n## How to plugin works\n\nInstead of storing each post, comment, user, term meta in a separate row,\nthis plugin lets you store them all in one row, with each meta key as a column.\n\n![WordPress Meta Table Vs Meta Optimizer Table](screenshots/table-structure.png \"WordPress Meta Table Vs Meta Optimizer Table\")\n\n\u0026nbsp;\n\n## Screenshots\n\n### Tables tab, You can manage meta table columns\n\n![Tables tab, You can manage meta table columns](screenshots/screenshot-1.png)\n\n### Reset section in tables tab, You can reset Meta Optimizer DB tables and import again meta data.\n\n![Tables tab, You can manage meta table columns](screenshots/screenshot-2.png)\n\n### Settings tab, Plugin options\n\n![Settings tab, Plugin options](screenshots/screenshot-3.png)\n\n### Import tab, Import options\n\n![Import tab, Import options](screenshots/screenshot-4.png)\n\n### Tools tab, Optimize WordPress functionality\n\n![Import tab, Import options](screenshots/screenshot-5.png)\n\n### Optimizer tab, Optimize WordPress Database\n\n![Import tab, Import options](screenshots/screenshot-6.png)\n\n\u0026nbsp;\n\n## Plugin Hooks\n\n### Change import items number\n\n```\nadd_filter( 'wpmetaoptimizer/import_items_number', function ( $importItemsNumber ) {\n    // return numeric value\n    return $importItemsNumber + 20;\n} );\n```\n\n\u0026nbsp;\n\n## Attention\n\nIf you use reserved column keys such as `post_id` for post meta, the plugin adds a suffix to the meta key. It creates a\ncolumn based on the renamed key. As an example, if you save meta with key `post_id`, then plugin adds `_wpmork` suffix\nand creates column `post_id_wpmork`. In response to a query (WP_Query), the plugin automatically changes the meta key if\nnecessary.\n\n\u0026nbsp;\n\n[Update post meta](https://developer.wordpress.org/reference/functions/update_post_meta/) example\n\n```\nupdate_post_meta(1, 'post_id', 222);\n```\n\nThe meta key has been changed to:\n\n```\nupdate_post_meta(1, 'post_id_wpmork', 222);\n```\n\n\u0026nbsp;\n\nExample [Query](https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters):\n\n```\n$query = new WP_Query(array(\n    'orderby' =\u003e array(\n        'post_id' =\u003e 'DESC'\n    ),\n    'meta_query' =\u003e array(\n        'post_id' =\u003e array(\n            'key' =\u003e 'post_id',\n            'compare' =\u003e 'EXISTS',\n            'type' =\u003e 'NUMERIC'\n        )\n    )\n));\n```\n\nPlugin changed a query to this:\n\n```\n$query = new WP_Query(array(\n    'orderby' =\u003e array(\n        'post_id_wpmork' =\u003e 'DESC'\n    ),\n    'meta_query' =\u003e array(\n        'post_id_wpmork' =\u003e array(\n            'key' =\u003e 'post_id_wpmork',\n            'compare' =\u003e 'EXISTS',\n            'type' =\u003e 'NUMERIC'\n        )\n    )\n));\n```\n\n\u0026nbsp;\n\n## Frequently Asked Questions\n\n**What type of meta types supported?**\n\n*Meta Optimizer can save default WordPress meta types like Post / User / Comment / Term.*\n\n**Can I use this plugin for custom post types?**\n\n*Yes, of course. Even though the plugin supports the built-in types of post and page, it is well suited to storing meta\ndata for custom post types.*\n\n**Can I rename meta key in DB tables?**\n\n*Yes, You can rename meta key in default WP tables and plugin tables.*\n\n\u0026nbsp;\n\n## Changelog\n\n### 1.4\n\n* Add a Tools tab to enhance WordPress functionality\n* Add an Optimizer tab to improve WordPress database performance\n* Show the size of each plugin table in the tables tab\n\n### 1.3\n\n* Add a filter for changing import item numbers\n  ([Documentation](https://parsakafi.github.io/wp-meta-optimizer/#plugin-hooks))\n* It is now possible to change the indexes of DB tables\n* You will be able to reset the plugin's database tables\n* The import tab now includes an estimate of import time\n\n### 1.2.2\n\n* Fix save array when insert new meta row\n\n### 1.2.1\n\n* NumericVal meta value \u0026 change field type when create db table field\n\n### 1.2\n\n* Fix bugs effected on save meta array value\n* Improve the import process\n\n### 1.1\n\n* Fix bugs effected on save meta array value\n\n### 1.0\n\n* Release a first version of plugin\n* Support get/add/update/delete meta functions and WordPress queries\n\n\u0026nbsp;\n\n## Unit Test\n\nCurrently, unit tests are limited to checking database tables and can't check plugin functionality! If you are able to\nhelp write tests for the plugin, please submit a pull request. Thank you :)\n\n1. [Initialize the testing environment locally](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/#3-initialize-the-testing-environment-locally)\n2. Install Dependency: `composer install`\n3. Run Test: Windows `./vendor/bin/phpunit` / Unix: `vendor/bin/phpunit` or `phpunit`\n\n\u0026nbsp;\n\n## Production plugin\n\nFor create production plugin, run this command in plugin directory:\n\nUnix: `bin/create-plugin.sh`\nWindows: `.\\bin\\create-plugin.sh`\n\n\u0026nbsp;\n\n### Documents\n\n[Documents page](https://parsakafi.github.io/wp-meta-optimizer/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparsakafi%2Fwp-meta-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparsakafi%2Fwp-meta-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparsakafi%2Fwp-meta-optimizer/lists"}