Skip to content

1.0.1 Optimization

Choose a tag to compare

@misfist misfist released this 14 May 20:20
· 2 commits to main since this release

Refactor plugin abstracts

Refactor plugin abstracts: remove unused Settings dependency and I18n class

  • Drop $settings from Base, Post_Type, Taxonomy constructors and all
    subclasses (Post_Types, Taxonomies, Blocks) — none used it
  • Fix double init() calls caused by subclasses calling $this->init()
    after parent::__construct() already invoked it
  • Remove I18n class and set_locale() — WP 6.5+ auto-loads text domains,
    making load_plugin_textdomain() on init redundant and a source of
    _doing_it_wrong() notices in WP 6.7+

Autoloading

Switch to Composer classmap autoloading; track vendor autoloader in git

  • Remove custom autoload.php — was not required by the bootstrapper
    and referenced dependencies (Alley autoloader, Strauss) that were
    never installed
  • Replace psr-4 autoload config with classmap; WordPress file naming
    conventions (class-*.php, lowercase dirs) are incompatible with PSR-4
  • Update .gitignore to track vendor/autoload.php and vendor/composer/
    so the autoloader is always present after a clone without needing
    composer install; use /vendor/*

Add modules system with remote media module

Add modules system with remote media module (1.0.1)

  • Introduce src/modules/ directory with class-modules.php as the loader,
    following the same pattern as Post_Types and Taxonomies
  • Add Remote_Media module: admin settings page for configuring a remote
    media URL, with an upload_dir filter that rewrites URLs on local
    environments to serve assets from the live site
  • Wire Modules into Site_Functionality::load_dependencies()

Remove asset classes, Settings; simplify bootstrap

Remove asset classes and Settings; simplify plugin bootstrap

  • Delete Admin_Assets, Frontend_Assets — not needed in this plugin
  • Delete Settings — only existed to serve the asset classes
  • Strip define_admin_hooks(), define_frontend_hooks(), and the Settings
    dependency from Site_Functionality; constructor now just calls
    load_dependencies()
  • Simplify instantiate_site_functionality() in the bootstrapper

Clean up

  • Remove src/app/templates/, src/app/admin/, src/app/frontend/ — empty
    or placeholder directories with no active code

Remote_Media toggle

Add enable/disable toggle to Remote_Media; expand environment support

  • Convert MENU_SLUG constant to $menu_slug property — no external
    consumers, no reason for it to be a constant
  • Fix serve_remote_media() fallback to use $this->remote_media_url
    instead of an empty string
  • Add $remote_media_enabled_option and a checkbox field to the settings
    page to toggle the feature on/off
  • Broaden environment check from local-only to any non-production
    environment; production is always blocked regardless of toggle state

Add $enabled_environments filter to Remote_Media

Add $enabled_environments filter to Remote_Media

Replaces the hardcoded production environment exclusion with an explicit
allowlist of permitted environments, filterable via
site_functionality_remote_media_environments to support custom environment
types beyond WordPress's built-in set.

Remove unused assets directory

Remove unused assets directory and update stale docblock

assets/js/admin.js and options.js were empty stubs with no enqueue
references anywhere in the plugin.

Full Changelog: 0.2.0...1.0.1