Drop deprecated folder#2623
Conversation
WalkthroughThis PR removes a deprecated WordPress plugin updater wrapper class and refactors the plugin's autoload logic from deprecation-based path routing to a pattern-driven class-naming strategy, alongside updating PHPStan configuration to no longer exclude deprecated files from analysis. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
formidable.php (1)
89-96: Pattern-based routing is clear and maintainable.The class name suffix matching logic correctly routes classes to their appropriate subdirectories.
If the project targets PHP 8.0+, consider refactoring to use
str_ends_with()for improved readability:- if ( preg_match( '/^.+Helper$/', $class_name ) ) { + if ( str_ends_with( $class_name, 'Helper' ) ) { $filepath .= 'helpers/'; - } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) { + } elseif ( str_ends_with( $class_name, 'Controller' ) ) { $filepath .= 'controllers/'; - } elseif ( preg_match( '/^.+Factory$/', $class_name ) ) { + } elseif ( str_ends_with( $class_name, 'Factory' ) ) { $filepath .= 'factories/'; - } elseif ( preg_match( '/^.+StyleComponent$/', $class_name ) ) { + } elseif ( str_ends_with( $class_name, 'StyleComponent' ) ) { $filepath .= 'views/styles/components/';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
phpcs.xmlis excluded by!**/*.xml
📒 Files selected for processing (3)
deprecated/FrmEDD_SL_Plugin_Updater.php(0 hunks)formidable.php(1 hunks)phpstan.neon(0 hunks)
💤 Files with no reviewable changes (2)
- phpstan.neon
- deprecated/FrmEDD_SL_Plugin_Updater.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: PHP 8 tests in WP trunk
- GitHub Check: PHP 7.4 tests in WP trunk
- GitHub Check: Cypress
- GitHub Check: Cypress
- GitHub Check: PHP 8 tests in WP trunk
- GitHub Check: PHP 7.4 tests in WP trunk
🔇 Additional comments (2)
formidable.php (2)
87-88: Good simplification of autoload logic.Removing the deprecated folder routing and unconditionally appending
/classes/makes the autoloader more straightforward and maintainable.
98-101: Field classes are properly located and deprecated folder has been successfully removed.All Field type classes are correctly positioned in
classes/models/fields/and the autoloader fallback logic at lines 98-101 works as intended. The deprecated folder has been completely removed with no remaining references. No further action needed.
…eprecated_FrmEDD_SL_Plugin_Updater_class Drop deprecated folder
No description provided.