Skip to content

Modernize plugin with React settings page and PHP 7.4+#25

Open
kraftbj wants to merge 1 commit intodevelopfrom
feature/modernize-settings
Open

Modernize plugin with React settings page and PHP 7.4+#25
kraftbj wants to merge 1 commit intodevelopfrom
feature/modernize-settings

Conversation

@kraftbj
Copy link
Copy Markdown
Owner

@kraftbj kraftbj commented Jan 8, 2026

Summary

  • Updates minimum requirements to WordPress 6.0+ and PHP 7.4+
  • Adds modern React-based settings page using @wordpress/components
  • Modernizes PHP codebase with strict types, typed properties, and arrow functions
  • Adds REST API for settings management
  • Includes wp-env configuration for easy local development

Changes

New Requirements

  • WordPress 6.0+
  • PHP 7.4+
  • Tested up to WordPress 6.9

Settings Page

  • Moved from Settings > Writing to dedicated Settings > Press This page
  • Built with React using @wordpress/components (Card, CheckboxControl, SelectControl, etc.)
  • Save button shows "Saved!" feedback for 2 seconds after successful save
  • REST API endpoint at /press-this-extended/v1/settings

PHP Modernization

  • Added declare(strict_types=1)
  • Used typed properties and return type declarations
  • Replaced anonymous functions with arrow functions
  • Removed load_plugin_textdomain() (automatic since WP 4.6)

Development

  • Added @wordpress/build for asset compilation
  • Added @wordpress/env for local development
  • Run pnpm install && pnpm build to build assets
  • Run pnpm env:start to start local WordPress environment (includes Press This plugin)

Test plan

  • Install on WordPress 6.0+ with PHP 7.4+
  • Navigate to Settings > Press This
  • Verify all settings load correctly
  • Change settings and click Save - verify "Saved!" appears on button
  • Verify settings persist after page reload
  • Test with Press This plugin to verify filters still work

- Update minimum requirements to WordPress 6.0+ and PHP 7.4+
- Update tested up to WordPress 6.9
- Add React-based settings page using @wordpress/components
- Add REST API for settings management
- Modernize PHP with strict types, typed properties, and arrow functions
- Move settings to dedicated page under Settings > Press This
- Add wp-env configuration for local development
- Add @wordpress/build for asset compilation
- Remove load_plugin_textdomain (automatic since WP 4.6)
- Remove bundled POT file (use translate.wordpress.org)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant